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

Add verbose and JSON output to OC-Client monitor #118

Merged
Merged
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
9 changes: 9 additions & 0 deletions internal/client/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ func setConfig(args []string) error {
statusCmd.BoolVar(&verbose, "verbose", verbose, "set verbose output")
statusCmd.BoolVar(&json, "json", json, "set json output")

// monitor subcommand
monitorCmd := flag.NewFlagSet("monitor", flag.ContinueOnError)
monitorCmd.BoolVar(&verbose, "verbose", verbose, "set verbose output")
monitorCmd.BoolVar(&json, "json", json, "set json output")

// define command line arguments
flags := flag.NewFlagSet(args[0], flag.ContinueOnError)
cfgFile := flags.String("config", "", "set config `file`")
Expand Down Expand Up @@ -130,6 +135,10 @@ func setConfig(args []string) error {
if err := statusCmd.Parse(args[2:]); err != nil {
return err
}
case "monitor":
if err := monitorCmd.Parse(args[2:]); err != nil {
return err
}
}

// set command
Expand Down
Loading