88 "syscall"
99
1010 "github.com/deis/workflow/client/parser"
11- "github.com/deis/workflow/client/version"
1211 docopt "github.com/docopt/docopt-go"
1312)
1413
@@ -25,6 +24,11 @@ The Deis command-line client issues API calls to a Deis controller.
2524
2625Usage: deis <command> [<args>...]
2726
27+ Option flags::
28+
29+ -h --help display help information
30+ -v --version display client version
31+
2832Auth commands::
2933
3034 register register a new user with a controller
@@ -47,6 +51,7 @@ Subcommands, use 'deis help [subcommand]' to learn more::
4751 perms manage permissions for applications
4852 git manage git for applications
4953 users manage users
54+ version display client version
5055
5156Shortcut commands, use 'deis shortcuts' to see all::
5257
@@ -64,7 +69,7 @@ Use 'git push deis master' to deploy to an application.
6469 // Reorganize some command line flags and commands.
6570 command , argv := parseArgs (argv )
6671 // Give docopt an optional final false arg so it doesn't call os.Exit().
67- _ , err := docopt .Parse (usage , []string {command }, false , version . Version , true , false )
72+ _ , err := docopt .Parse (usage , []string {command }, false , "" , true , false )
6873
6974 if err != nil {
7075 fmt .Fprintln (os .Stderr , err )
@@ -107,11 +112,11 @@ Use 'git push deis master' to deploy to an application.
107112 err = parser .Git (argv )
108113 case "users" :
109114 err = parser .Users (argv )
115+ case "version" :
116+ err = parser .Version (argv )
110117 case "help" :
111118 fmt .Print (usage )
112119 return 0
113- case "--version" :
114- return 0
115120 default :
116121 env := os .Environ ()
117122 extCmd := "deis-" + command
@@ -149,9 +154,12 @@ Use 'git push deis master' to deploy to an application.
149154// expands shortcuts and formats commands to be properly routed.
150155func parseArgs (argv []string ) (string , []string ) {
151156 if len (argv ) == 1 {
152- // rearrange "deis --help" as "deis help"
153157 if argv [0 ] == "--help" || argv [0 ] == "-h" {
158+ // rearrange "deis --help" as "deis help"
154159 argv [0 ] = "help"
160+ } else if argv [0 ] == "--version" || argv [0 ] == "-v" {
161+ // rearrange "deis --version" as "deis version"
162+ argv [0 ] = "version"
155163 }
156164 }
157165
0 commit comments