API¶
-
clik_shell.exclude_from_shell(command_or_fn)[source]¶ Exclude command from the shell interface.
This decorator can be applied before or after the command decorator:
@exclude_from_shell @myapp def mycommand(): # is the same as @myapp @exclude_from_shell def mycommand():
Parameters: command_or_fn ( clik.command.Commandor function) – Command instance or functionReturns: Whatever was passed in
-
class
clik_shell.BaseShell(command)[source]¶ Bases:
cmd.CmdMinimal implementation to integrate clik and cmd.
-
__init__(command)[source]¶ Instantiate the command loop.
Parameters: command ( clik.command.Command) – “Root” command object (usually the application object created byclik.app.app())
-
default(line)[source]¶ Override that hackily supports commands with hyphens.
See the quickstart in the documentation for further explanation.
Parameters: line (str) – Line whose command is unrecognized Return type: None
-
-
class
clik_shell.DefaultShell(command)[source]¶ Bases:
clik_shell.BaseShellCommand loop subclass that implements commonly desire facilities.
-
emptyline()[source]¶ Override that turns an empty line into a no-op.
By default, the command loop runs the previous command when an empty line is received. This is bad default behavior because it’s not what users expect.
If “run the last command” is the desired behavior, you should extend
BaseClassrather than this class.
-