Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
snapctl: use default in metric get
Browse files Browse the repository at this point in the history
the flag for metric version has a default, but `snapctl metric get`
still required both namespace and version be passed in. Now, the default
(0 / latest) will be used when no `-v` is passed.
  • Loading branch information
pittma committed Mar 18, 2016
1 parent 6bf5b20 commit e1f7bf0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/snapctl/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ var (
// metric
flMetricVersion = cli.IntFlag{
Name: "metric-version, v",
Usage: "The metric version",
Usage: "The metric version. Default (0) is latest",
}
flMetricNamespace = cli.StringFlag{
Name: "metric-namespace, m",
Expand Down
4 changes: 2 additions & 2 deletions cmd/snapctl/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ func listMetrics(ctx *cli.Context) {
}

func getMetric(ctx *cli.Context) {
if !ctx.IsSet("metric-namespace") || !ctx.IsSet("metric-version") {
fmt.Println("namespace and version are required")
if !ctx.IsSet("metric-namespace") {
fmt.Println("namespace is required")
fmt.Println("")
cli.ShowCommandHelp(ctx, ctx.Command.Name)
return
Expand Down

0 comments on commit e1f7bf0

Please sign in to comment.