1 package com.lexicalscope.jewel.cli; 2 3 /** 4 * Parses arguments and presents them, in a typesafe style, as an instance of 5 * the interface <code>O</code> 6 * 7 * @author Tim Wood 8 * 9 * @param <O> 10 * The type of interface provided by this Cli 11 */ 12 public interface Cli<O> { 13 /** 14 * Parse the arguments and present them as an instance of the interface O 15 * 16 * @param arguments 17 * The arguments that will be parsed 18 * 19 * @return An instance of the interface O which will present the parsed 20 * arguments 21 * 22 * @throws ArgumentValidationException the arguments do not meet the cli specification 23 */ 24 O parseArguments(String... arguments) throws ArgumentValidationException; 25 26 /** 27 * Get a help message suitable for describing the options to the user 28 * 29 * @return A help message 30 */ 31 String getHelpMessage(); 32 33 /** 34 * BETA: may be removed or altered in future versions 35 * 36 * Fill in a help message suitable for describing the options to the user 37 */ 38 void describeTo(HelpMessage helpMessage); 39 }