ui.argparse_commons

pywi.ui.argparse_commons.add_common_arguments(parser, nargs=1)[source]

Populate the given argparse.ArgumentParser with arguments.

This function can be used to centralize the definition of commons argparse arguments and avoid the duplication of these definitions among the executable scripts.

The following arguments are added to the parser:

  • verbose (boolean): verbose mode
  • debug (boolean): debug mode
  • plot (boolean): plot images
  • saveplot (string): the output file where to save plotted images
  • fileargs (file paths): the files image to process
Parameters:parser (argparse.ArgumentParser) – The parser to populate.
Returns:Return the populated ArgumentParser object.
Return type:argparse.ArgumentParser