cli: CLI entrypoint

invoke.cli.parse(argv, collection=None)

Parse argv list-of-strings into useful core & per-task structures.

Returns:Three-tuple of args (core, non-task Argument objects), collection (compiled Collection of tasks, using defaults or core arguments affecting collection generation) and tasks (a list of Context objects representing the requested task executions).
invoke.cli.parse_gracefully(parser, argv)

Run parser.parse_argv(argv) & gracefully handle ParseError.

‘Gracefully’ meaning to print a useful human-facing error message instead of a traceback; the program will still exit if an error is raised.

If no error is raised, returns the result of the parse_argv call.

Previous topic


Next topic

Collection: Task collections

This Page