pbcommand Commandline Interface

Pacbio Commandline

pbcommand.cli.pacbio_args_or_contract_runner(argv, parser, args_runner_func, contract_tool_runner_func, alog, setup_log_func)[source]

For tools that understand resolved_tool_contracts, but can’t emit tool contracts (they may have been written by hand)

Parameters:
  • parser (ArgumentParser) – argparse Parser
  • args_runner_func – func(args) => int signature
  • contract_tool_runner_func – func(tool_contract_instance) should be the signature
  • alog – a python log instance
  • setup_log_func – func(log_instance) => void signature
Returns:

int return code

Return type:

int

pbcommand.cli.pbparser_runner(argv, parser, args_runner_func, contract_runner_func, alog, setup_log_func)[source]

Run a Contract or emit a contract to stdout.

pbcommand.cli.get_default_argparser(version, description)[source]

Everyone should use this to create an instance on a argparser python parser.

This should be replaced updated to have the required base options

Parameters:
  • version – Version of your tool
  • description – Description of your tool
Returns:

Return type:

ArgumentParser

pbcommand.cli.get_default_argparser_with_base_opts(version, description, default_level='INFO')[source]

Return a parser with the default log related options

If you don’t want the default log behavior to go to stdout, then set the default log level to be “ERROR”. This will essentially suppress all output to stdout.

Default behavior will only emit to stderr. This is essentially a ‘–quiet’ default mode.

my-tool –my-opt=1234 file_in.txt

To override the default behavior and add a chatty-er stdout

my-tool –my-opt=1234 –log-level=INFO file_in.txt

Or write the console output to write the log file to an explict file and leave the stdout untouched.

my-tool –my-opt=1234 –log-level=DEBUG –log-file=file.log file_in.txt