Command-line Interface Modules

The delphin.cli package is a namespace package for modules that define command-line interfaces. Each module under delphin.cli must have a dictionary named COMMAND_INFO and defined as follows:

    'name': 'command-name',             # Required
    'help': 'short help message',       # Optional
    'description': 'long description',  # Optional
    'parser': parser,                   # Required

The name field is the subcommand (e.g., delphin command-name) and the parser field is a argparse.ArgumentParser instance that specifies available arguments. Some common options, such as --verbose (-v), --quiet (-q), and --version (-V) will be created automatically by PyDelphin. This parser should also specify a func callable attribute that is called when the subcommand is used. Thus, the recommended way to create parser is as follows:

parser = argparse.ArgumentParser(add_help=False)

All of the default commands in delphin.commands define their command-line interface in the delphin.cli namespace.