File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2208,7 +2208,17 @@ def main():
22082208 if hasattr (cli , cmd ):
22092209 method = getattr (cli , cmd )
22102210 else :
2211- raise DocoptExit ('Found no matching command, try `deis help`' )
2211+ # split by : to execute the proper command
2212+ split_cmd = args ['<command>' ].split (':' )
2213+ dash_separated_command = 'deis-{}' .format (split_cmd [0 ])
2214+ arglist = args ['<args>' ]
2215+ if len (split_cmd ) > 1 :
2216+ # safety precaution in case users want to use more than one colon in their command
2217+ arglist = split_cmd [1 :] + arglist
2218+ try :
2219+ sys .exit (subprocess .call ([dash_separated_command ] + arglist ))
2220+ except OSError :
2221+ raise DocoptExit ('Found no matching command, try `deis help`' )
22122222 # re-parse docopt with the relevant docstring
22132223 docstring = trim (getattr (cli , cmd ).__doc__ )
22142224 if 'Usage: ' in docstring :
Original file line number Diff line number Diff line change 1+ :title: CLI Plugins
2+ :description: How to manage plugins for the Deis CLI.
3+
4+ .. _cli_plugins :
5+
6+ CLI Plugins
7+ ===========
8+
9+ Plugins allow developers to extend the functionality of the :ref: `Deis Client <install-client >`,
10+ adding new commands or features.
11+
12+ If an unknown command is specified, the Client will attempt to execute the command as a
13+ dash-separated command. In this case, ``deis resource:command `` will execute ``deis-resource `` with
14+ the argument list ``command ``. In full form:
15+
16+ .. code-block :: console
17+
18+ $ # these two are identical
19+ $ deis accounts:list
20+ $ deis-accounts list
21+
22+ Any flags after the command will also be sent to the plugin as an argument:
23+
24+ .. code-block :: console
25+
26+ $ # these two are identical
27+ $ deis accounts:list --debug
28+ $ deis-accounts list --debug
29+
30+ But flags preceeding the command will not:
31+
32+ .. code-block :: console
33+
34+ $ # these two are identical
35+ $ deis --debug accounts:list
36+ $ deis-accounts list
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ Customizing Deis
1111
1212.. toctree ::
1313
14+ cli-plugins
1415 builder_settings
1516 cache_settings
1617 controller_settings
You can’t perform that action at this time.
0 commit comments