cmd_args module

This module contains code for configuring commandline argument support and related argparse actions.

class lib.cmd_args.NumberFilterAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)

An argparse.Action subclass that validates the number filters. Accepts inputs like <x, = x or >=x, where x is an integer.

Ignores a space in the middle.

Raises

ValueError – if an incorrect format is provided

class lib.cmd_args.ReadableDirectoryAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)

An argparse.Action subclass that checks if a directory is readable.

Raises
  • ArgumentTypeError – if a path is invalid

  • ArgumentTypeError – if a directory is unreadable

lib.cmd_args.configure_parser()

Configures argparse to accept arguments needed by the tagnet utility like “path”, “output_file”, “mode”, “filter”, etc.