@@ -586,12 +586,12 @@ def apps_run(self, args):
586586 """
587587 Run a command inside an ephemeral app container
588588
589- Usage: deis apps:run <command>...
589+ Usage: deis apps:run [--app=<app> --] <command>...
590590 """
591591 app = args .get ('--app' )
592592 if not app :
593593 app = self ._session .app
594- body = {'command' : ' ' .join (sys . argv [ 2 :] )}
594+ body = {'command' : ' ' .join (args . get ( '<command>' ) )}
595595 response = self ._dispatch ('post' ,
596596 "/api/apps/{}/run" .format (app ),
597597 json .dumps (body ))
@@ -1678,11 +1678,10 @@ def main():
16781678 method = getattr (cli , cmd )
16791679 else :
16801680 raise DocoptExit ('Found no matching command, try `deis help`' )
1681- # re-parse docopt with the relevant docstring unless it needs sys.argv
1682- if cmd not in ('apps_run' ,):
1683- docstring = trim (getattr (cli , cmd ).__doc__ )
1684- if 'Usage: ' in docstring :
1685- args .update (docopt (docstring ))
1681+ # re-parse docopt with the relevant docstring
1682+ docstring = trim (getattr (cli , cmd ).__doc__ )
1683+ if 'Usage: ' in docstring :
1684+ args .update (docopt (docstring ))
16861685 # dispatch the CLI command
16871686 _dispatch_cmd (method , args )
16881687
0 commit comments