scriptine.command – run scripts with commands

Module Contents, args=None, command_suffix='_command', add_dry_run_option=True, add_verbosity_option=True)

Parse and run commands.

Will search namespace for functions that end with command_suffix.

  • namespace – the namespace/module to search for commands
  • args – the arguments for the command parser. defaults to sys.argv
  • command_suffix – function name suffix that indicates that a function is a command.

Command decorators

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:

def foo_command(required_arg, the_rest):
    print '|'.join(the_rest)

The result when calling this command:

% foo arg1 arg2 arg3

If you are interessted in aditional options (e.g. --bar) use fetch_all() together with the non_strict() decorator.

Table Of Contents

Previous topic


Next topic

scriptine.log – simple logging for commands

This Page