Skip to content

Commit 2cec00b

Browse files
committed
Merge pull request #2756 from mboersma/fix-cmd-args
fix(deisctl): parse global and command-specific options correctly
2 parents 53fc4ae + d09e3f6 commit 2cec00b

3 files changed

Lines changed: 4 additions & 19 deletions

File tree

deisctl/cmd/cmd.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -583,11 +583,8 @@ Note: "deisctl config platform set sshPrivateKey=" expects a path
583583
to a private key.
584584
585585
Usage:
586-
deisctl config <target> get [<key>...] [options]
587-
deisctl config <target> set <key=val>... [options]
588-
589-
Options:
590-
--verbose print out the request bodies [default: false]
586+
deisctl config <target> get [<key>...]
587+
deisctl config <target> set <key=val>...
591588
592589
Examples:
593590
deisctl config platform set domain=mydomain.com

deisctl/config/config.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ import (
99

1010
// Config runs the config subcommand
1111
func Config(args map[string]interface{}) error {
12-
err := setConfigFlags(args)
13-
if err != nil {
14-
return err
15-
}
1612
return doConfig(args)
1713
}
1814

@@ -33,14 +29,6 @@ func CheckConfig(root string, k string) error {
3329
return nil
3430
}
3531

36-
// Flags for config package
37-
var Flags struct {
38-
}
39-
40-
func setConfigFlags(args map[string]interface{}) error {
41-
return nil
42-
}
43-
4432
func doConfig(args map[string]interface{}) error {
4533
client, err := getEtcdClient()
4634
if err != nil {

deisctl/deisctl.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func main() {
3030
func Command(argv []string) int {
3131
deisctlMotd := utils.DeisIfy("Deis Control Utility")
3232
usage := deisctlMotd + `
33-
Usage: deisctl <command> [<args>...] [options]
33+
Usage: deisctl [options] <command> [<args>...]
3434
3535
Commands, use "deisctl help <command>" to learn more:
3636
install install components, or the entire platform
@@ -62,7 +62,7 @@ Options:
6262
// pre-parse command-line arguments
6363
argv, helpFlag := parseArgs(argv)
6464
// give docopt an optional final false arg so it doesn't call os.Exit()
65-
args, err := docopt.Parse(usage, argv, false, Version, false, false)
65+
args, err := docopt.Parse(usage, argv, false, Version, true, false)
6666
if err != nil || len(args) == 0 {
6767
if helpFlag {
6868
fmt.Print(usage)

0 commit comments

Comments
 (0)