Package documentation
Functions
- ezcli.config([appname,] [appversion,] [language='en'])
Configure ezCLI.
- Parameters
appname (str) – The name of the application
appversion (str) – The version of the application
language (str) – The language to use for auto-generated content
- Return type
None
- Raises
EzCLIError – if ezCLI is already configured, or if the language isn’t supported
- ezcli.arguments(opt1, opt2, ..., param1, param2, ...)
Parse command-line arguments. If a
-h
or--help
argument is given, display an auto-generated help message and exits.- Parameters
opt1,opt2,... (tuple) – the command-line options of the application. they’re tuples like
('-a', '--my-option', TYPE, 'description')
where'-a'
and'--my-option'
are the forms the option can take (at least one),TYPE
is the option type and'description'
its description.param1,param2,... (ParameterType) – the command-line parameters of the application. they shold always be given after the options.
- Returns
None if the app takes no arguments, the value of the option/parameter if there’s only one, else a tuple with the value of each of the options, in the order they were passed to the function.
- Raises
EzCLIError – If an option isn’t valid or given after a parameter