cloudmesh.shell.command
¶
Module Contents¶
Functions¶
|
This command is useful to map parameters with – to regular argument dicts |
|
A decorator to create a function with docopt arguments. |
|
A decorator to create a function with docopt arguments. |
-
class
cloudmesh.shell.command.
PluginCommand
¶ Bases:
object
-
class
cloudmesh.shell.command.
CloudPluginCommand
¶ Bases:
object
-
class
cloudmesh.shell.command.
ShellPluginCommand
¶ Bases:
object
-
class
cloudmesh.shell.command.
HPCPluginCommand
¶ Bases:
object
-
class
cloudmesh.shell.command.
CometPluginCommand
¶ Bases:
object
-
cloudmesh.shell.command.
map_parameters
(arguments, *args)¶ This command is useful to map parameters with – to regular argument dicts for easier processing.
- Parameters
arguments –
args –
- Returns
an example is
- map_parameters(arguments,
‘active’, ‘cloud’)
where –active=ACTIVE is mapped to arguments[“active”] and –cloud=CLOUD is mapped to arguments[“cloud”]
as arguments is a dotdict, they can than for example be called as
arguments.cloud
-
cloudmesh.shell.command.
command
(func)¶ A decorator to create a function with docopt arguments. It also generates a help function
@command def do_myfunc(self, args):
“”” docopts text “”” pass
will create
- def do_myfunc(self, args, arguments):
“”” docopts text “”” …
- def help_myfunc(self, args, arguments):
… prints the docopt text …
- Parameters
func – the function for the decorator
-
cloudmesh.shell.command.
basecommand
(func)¶ A decorator to create a function with docopt arguments. It also generates a help function
@command def do_myfunc(self, args):
“”” docopts text “”” pass
will create
- def do_myfunc(self, args, arguments):
“”” docopts text “”” …
- def help_myfunc(self, args, arguments):
… prints the docopt text …
- Parameters
func – the function for the decorator