Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update github.com/spf13/pflag and github.com/spf13/cobra #27855

Merged
merged 1 commit into from
Aug 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cmd/hyperkube/hyperkube_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ func TestServerHelp(t *testing.T) {
x := runFull(t, "hyperkube test1 --help")
assert.NoError(t, x.err)
assert.Contains(t, x.output, "A simple server named test1")
assert.Contains(t, x.output, "--help[=false]: help for hyperkube")
assert.Contains(t, x.output, "-h, --help help for hyperkube")
assert.NotContains(t, x.output, "test1 Run")
}

func TestServerFlagsBad(t *testing.T) {
x := runFull(t, "hyperkube test1 --bad-flag")
assert.EqualError(t, x.err, "unknown flag: --bad-flag")
assert.Contains(t, x.output, "A simple server named test1")
assert.Contains(t, x.output, "--help[=false]: help for hyperkube")
assert.Contains(t, x.output, "-h, --help help for hyperkube")
assert.NotContains(t, x.output, "test1 Run")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a little bit strange, the help output really contains so many extra spaces?

Copy link
Contributor Author

@andreykurilin andreykurilin Aug 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Here you can find example(several options) of old help:

      --global-housekeeping-interval=1m0s: Interval between global housekeepings
      --google-json-key="": The Google Cloud Platform Service Account JSON Key to use for authentication.
      --healthz-bind-address=127.0.0.1: The IP address for the health check server to serve on, defaulting to 127.0.0.1 (set to 0.0.0.0 for all interfaces)
      --healthz-port=10249: The port to bind the health check server. Use 0 to disable.
  -h, --help[=false]: help for hyperkube
      --hostname-override="": If non-empty, will use this string as identification instead of the actual hostname.
      --housekeeping-interval=10s: Interval between container housekeepings
      --iptables-masquerade-bit=14: If using the pure iptables proxy, the bit of the fwmark space to mark packets requiring SNAT with.  Must be within the range [0, 31].
      --iptables-sync-period=30s: How often iptables rules are refreshed (e.g. '5s', '1m', '2h22m').  Must be greater than 0.

after this patch it will look like:

      --global-housekeeping-interval value                 Interval between global housekeepings (default 1m0s)
      --google-json-key string                             The Google Cloud Platform Service Account JSON Key to use for authentication.
      --healthz-bind-address value                         The IP address for the health check server to serve on, defaulting to 127.0.0.1 (set to 0.0.0.0 for all interfaces) (default 127.0.0.1)
      --healthz-port value                                 The port to bind the health check server. Use 0 to disable. (default 10249)
  -h, --help                                               help for hyperkube
      --hostname-override string                           If non-empty, will use this string as identification instead of the actual hostname.
      --housekeeping-interval value                        Interval between container housekeepings (default 10s)
      --iptables-masquerade-bit value                      If using the pure iptables proxy, the bit of the fwmark space to mark packets requiring SNAT with.  Must be within the range [0, 31]. (default 14)
      --iptables-sync-period duration                      How often iptables rules are refreshed (e.g. '5s', '1m', '2h22m').  Must be greater than 0. (default 30s)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this looks more user friendly. Thanks @andreykurilin

}

Expand Down
4 changes: 2 additions & 2 deletions contrib/mesos/cmd/km/hyperkube_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ func TestServerHelp(t *testing.T) {
x := runFull(t, "hyperkube test1 --help")
assert.NoError(t, x.err)
assert.Contains(t, x.output, "A simple server named test1")
assert.Contains(t, x.output, "--help[=false]: help for hyperkube")
assert.Contains(t, x.output, "-h, --help help for hyperkube")
assert.NotContains(t, x.output, "test1 Run")
}

func TestServerFlagsBad(t *testing.T) {
x := runFull(t, "hyperkube test1 --bad-flag")
assert.EqualError(t, x.err, "unknown flag: --bad-flag")
assert.Contains(t, x.output, "A simple server named test1")
assert.Contains(t, x.output, "--help[=false]: help for hyperkube")
assert.Contains(t, x.output, "-h, --help help for hyperkube")
assert.NotContains(t, x.output, "test1 Run")
}

Expand Down
12 changes: 12 additions & 0 deletions vendor/github.com/spf13/cobra/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions vendor/github.com/spf13/cobra/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 22 additions & 1 deletion vendor/github.com/spf13/cobra/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 35 additions & 7 deletions vendor/github.com/spf13/cobra/bash_completions.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/github.com/spf13/cobra/bash_completions.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions vendor/github.com/spf13/cobra/cobra.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading