Parse and run commands.
Will search namespace for functions that end with command_suffix.
Parameters: |
|
---|
These decorators set options on command functions.
Disable the --help option for this command.
Disable the --verbose and --quite options for this command.
Disable strict argument parsing. Does not report an error when the command is called with unknown options.
Pass all arguments that the parser did not matche to an options or argument to this named arg_name.
Use this decorator when you are interessted in all arguments:
@fetch_all('args')
def foo_command(required_arg, the_rest):
print '|'.join(the_rest)
The result when calling this command:
% example.py foo arg1 arg2 arg3
arg2|arg3
If you are interessted in aditional options (e.g. --bar) use fetch_all() together with the non_strict() decorator.