Package kenozooid :: Package cli

Package cli

source code

Commmand line user interface.
Submodules

Classes
  CLICommand
Kenozooid's command.
  ArgumentError
Error to indicate incorrect Kenozooid command arguments.
  NoCommandError
No Kenozooid command specified.
  UDDFInputAction
Parse arguments being a list of UDDF input files with '-k' option per input file.
Functions
 
add_commands(parser, prefix=None, title=None)
Find and add commands to the argument parser.
source code
 
add_master_command(name, title, desc)
Add master command.
source code
 
add_uddf_input(parser)
Add list of UDDF files as input argument to a parser.
source code
Variables
  __package__ = 'kenozooid.cli'
Function Details

add_commands(parser, prefix=None, title=None)

source code 
Find and add commands to the argument parser.
Parameters:
  • parser - Argument parser (from argparse module).
  • prefix - Prefix of commands to add to argument parser.
  • title - Help title of commands.

add_master_command(name, title, desc)

source code 

Add master command.

The purpose of master command is to

  • group other commands as sub-commands, i.e. 'dive' master command for 'list' and 'add' sub-commands means there are 'dive list' and 'dive add' commands.
  • provide help title and generalized help description of groupped sub-commands
Parameters:
  • name - Command name.
  • title - Command help title.
  • desc - Command description.

add_uddf_input(parser)

source code 

Add list of UDDF files as input argument to a parser.

The function adds several options and arguments

  • -n is added to fetch dives by their number
  • multiple UDDF files can be specified
  • each file can be preceded with -k option to indicate which dives should be fetched from a file

The -k and -n options are glued with 'and' operator - use only one of them if confused.

Parameters:
  • parser - argparse library parser.