route#

scikitplot._ipymagic.route(argv)[source]#

Return the command argv names, as the CLI would find it.

Parameters:
argvsequence of str

Arguments after scikitplot.

Returns:
Route

The command and how it runs.

Raises:
MagicUsageError

When the first word that is not an option is not a command or an alias (and no delegated command follows); the closest names are in the hint.

Parameters:

argv (Sequence[str])

Return type:

Route

Notes

The delegated decision is the CLI’s own (_split_delegated): the first word anywhere in argv that names a command decides, so -vq env, --verb env and -v env all delegate, exactly as on the command line. The root parser takes no option with a value, so the first word that is not an option is the one argparse and click read as the command.

Examples

>>> from scikitplot._ipymagic import route
>>> route(["-v", "env", "plan"])
Route(command='env', delegated=True)