curldl.cli module#

Command-line interface, should be called via main module: python -m curldl

class curldl.cli.CommandLine[source]#

Bases: object

Command-line interface, exposed via module entry point

Initialize argument parser and unhandled exception hook

static _configure_logger(args: Namespace) None[source]#

Configure logger according to command-line arguments. Specifying verbose argument raises the log level to debug.

Parameters:

args (Namespace) – command-line arguments

classmethod _parse_arguments() Namespace[source]#

Parse command-line arguments.

Returns:

arguments after configuring the logger and possibly inferring other arguments

Return type:

Namespace

classmethod _infer_arguments(output_arg: Action, args: Namespace) Namespace[source]#

Infer missing arguments.

Parameters:
  • output_arg (Action) – output argument to infer

  • args (Namespace) – arguments to extend

Returns:

input arguments after inferring missing ones

Raises:

argparse.ArgumentError – multiple URLs are specified with output argument

Return type:

Namespace

main() object[source]#

Command-line program entry point.

Returns:

program exit status

Return type:

object

static _get_package_version() str[source]#

Retrieve package version from metadata, raising error for uninstalled development sources.

Returns:

package version string

Raises:

metadata.PackageNotFoundError – version is not available, e.g. when package is not installed

Return type:

str

curldl.cli.main() object[source]#

Command-line static entry point, suitable for install-time script generation.

Returns:

program exit status

Return type:

object