Command line

Note

The documentation in this section is aimed at people wishing to contribute to cupage, and can be skipped if you are simply using the tool from the command line.

cupage.cmdline.USAGE = '%(prog)s checks web pages and displays changes from the last run that match\na given criteria. Its original purpose was to check web pages for new software\nreleases, but it is easily configurable and can be used for other purposes.'

Command line help string, for use with argparse

cupage.cmdline.main()[source]

Main script handler.

cupage.cmdline.add()[source]

Commands are the basic building block of command line interfaces in Click. A basic command handles command line parsing and might dispatch more parsing to commands nested below it.

Changed in version 2.0: Added the context_settings parameter.

Parameters:
  • name – the name of the command to use unless a group overrides it.
  • context_settings – an optional dictionary with defaults that are passed to the context object.
  • callback – the callback to invoke. This is optional.
  • params – the parameters to register with this command. This can be either Option or Argument objects.
  • help – the help string to use for this command.
  • epilog – like the help string but it’s printed at the end of the help page after everything else.
  • short_help – the short help to use for this command. This is shown on the command listing of the parent command.
  • add_help_option – by default each command registers a --help option. This can be disabled by this parameter.
cupage.cmdline.check()[source]

Commands are the basic building block of command line interfaces in Click. A basic command handles command line parsing and might dispatch more parsing to commands nested below it.

Changed in version 2.0: Added the context_settings parameter.

Parameters:
  • name – the name of the command to use unless a group overrides it.
  • context_settings – an optional dictionary with defaults that are passed to the context object.
  • callback – the callback to invoke. This is optional.
  • params – the parameters to register with this command. This can be either Option or Argument objects.
  • help – the help string to use for this command.
  • epilog – like the help string but it’s printed at the end of the help page after everything else.
  • short_help – the short help to use for this command. This is shown on the command listing of the parent command.
  • add_help_option – by default each command registers a --help option. This can be disabled by this parameter.
cupage.cmdline.list_conf()[source]

Commands are the basic building block of command line interfaces in Click. A basic command handles command line parsing and might dispatch more parsing to commands nested below it.

Changed in version 2.0: Added the context_settings parameter.

Parameters:
  • name – the name of the command to use unless a group overrides it.
  • context_settings – an optional dictionary with defaults that are passed to the context object.
  • callback – the callback to invoke. This is optional.
  • params – the parameters to register with this command. This can be either Option or Argument objects.
  • help – the help string to use for this command.
  • epilog – like the help string but it’s printed at the end of the help page after everything else.
  • short_help – the short help to use for this command. This is shown on the command listing of the parent command.
  • add_help_option – by default each command registers a --help option. This can be disabled by this parameter.
cupage.cmdline.list_sites()[source]

Commands are the basic building block of command line interfaces in Click. A basic command handles command line parsing and might dispatch more parsing to commands nested below it.

Changed in version 2.0: Added the context_settings parameter.

Parameters:
  • name – the name of the command to use unless a group overrides it.
  • context_settings – an optional dictionary with defaults that are passed to the context object.
  • callback – the callback to invoke. This is optional.
  • params – the parameters to register with this command. This can be either Option or Argument objects.
  • help – the help string to use for this command.
  • epilog – like the help string but it’s printed at the end of the help page after everything else.
  • short_help – the short help to use for this command. This is shown on the command listing of the parent command.
  • add_help_option – by default each command registers a --help option. This can be disabled by this parameter.
cupage.cmdline.remove()[source]

Commands are the basic building block of command line interfaces in Click. A basic command handles command line parsing and might dispatch more parsing to commands nested below it.

Changed in version 2.0: Added the context_settings parameter.

Parameters:
  • name – the name of the command to use unless a group overrides it.
  • context_settings – an optional dictionary with defaults that are passed to the context object.
  • callback – the callback to invoke. This is optional.
  • params – the parameters to register with this command. This can be either Option or Argument objects.
  • help – the help string to use for this command.
  • epilog – like the help string but it’s printed at the end of the help page after everything else.
  • short_help – the short help to use for this command. This is shown on the command listing of the parent command.
  • add_help_option – by default each command registers a --help option. This can be disabled by this parameter.

Examples

Parse command line options

>>> options, args = process_command_line()