mirror of https://github.com/knative/client.git
Added basic version of quiet mode to service create command
This commit is contained in:
parent
bb1f899634
commit
2950b024ac
|
@ -148,7 +148,13 @@ func NewServiceCreateCommand(p *commands.KnParams) *cobra.Command {
|
|||
return err
|
||||
}
|
||||
|
||||
out := cmd.OutOrStdout()
|
||||
var out io.Writer
|
||||
if p.QuietMode {
|
||||
out = io.Discard
|
||||
} else {
|
||||
out = cmd.OutOrStdout()
|
||||
}
|
||||
|
||||
if serviceExists {
|
||||
if !editFlags.ForceCreate {
|
||||
return fmt.Errorf(
|
||||
|
|
|
@ -70,6 +70,8 @@ type KnParams struct {
|
|||
// General global options
|
||||
LogHTTP bool
|
||||
|
||||
QuietMode bool
|
||||
|
||||
// Set this if you want to nail down the namespace
|
||||
fixedCurrentNamespace string
|
||||
}
|
||||
|
|
|
@ -92,6 +92,7 @@ Find more information about Knative at: https://knative.dev`, rootName),
|
|||
rootCmd.PersistentFlags().StringVar(&p.KubeAsUID, "as-uid", "", "uid to impersonate for the operation")
|
||||
rootCmd.PersistentFlags().StringArrayVar(&p.KubeAsGroup, "as-group", []string{}, "group to impersonate for the operation, this flag can be repeated to specify multiple groups")
|
||||
flags.AddBothBoolFlags(rootCmd.PersistentFlags(), &p.LogHTTP, "log-http", "", false, "log http traffic")
|
||||
rootCmd.PersistentFlags().BoolVarP(&p.QuietMode, "quiet-mode", "q", false, "run commands in quiet mode")
|
||||
|
||||
// Grouped commands
|
||||
groups := templates.CommandGroups{
|
||||
|
|
Loading…
Reference in New Issue