Utils
sereto.cli.utils
¶
AliasedGroup
¶
Bases: Group
A click Group subclass that allows for writing aliases and prefixes of any command.
Source code in sereto/cli/utils.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
get_command(ctx, cmd_name)
¶
Retrieves the command with the given name.
If the command is not found, it looks up an explicit command alias or a command prefix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
Context
|
The click context object. |
required |
cmd_name
|
str
|
The name of the command to retrieve. |
required |
Returns:
| Type | Description |
|---|---|
Command | None
|
The command with the given name, or None if no command is found. |
Source code in sereto/cli/utils.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
resolve_command(ctx, args)
¶
Resolves the full command's name.
Source code in sereto/cli/utils.py
44 45 46 47 48 49 50 51 | |
Console
¶
Bases: Console
Singleton wrapper around Rich's Console.
Source code in sereto/cli/utils.py
65 66 | |
load_enum(enum, message)
¶
Let user select a value from enum.
Source code in sereto/cli/utils.py
54 55 56 57 58 59 60 61 62 | |