Skip to content

Commit

Permalink
update completions
Browse files Browse the repository at this point in the history
  • Loading branch information
juanvallejo committed Jan 11, 2018
1 parent 6a9c123 commit 5428dd7
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 13 deletions.
16 changes: 13 additions & 3 deletions contrib/completions/bash/oc
Original file line number Diff line number Diff line change
Expand Up @@ -15784,6 +15784,8 @@ _oc_rollback()
flags_with_completion=()
flags_completion=()

flags+=("--allow-missing-template-keys")
local_nonpersistent_flags+=("--allow-missing-template-keys")
flags+=("--change-scaling-settings")
local_nonpersistent_flags+=("--change-scaling-settings")
flags+=("--change-strategy")
Expand All @@ -15793,15 +15795,23 @@ _oc_rollback()
flags+=("--dry-run")
flags+=("-d")
local_nonpersistent_flags+=("--dry-run")
flags+=("--no-headers")
local_nonpersistent_flags+=("--no-headers")
flags+=("--output=")
two_word_flags+=("-o")
local_nonpersistent_flags+=("--output=")
flags+=("--output-version=")
local_nonpersistent_flags+=("--output-version=")
flags+=("--show-all")
flags+=("-a")
local_nonpersistent_flags+=("--show-all")
flags+=("--show-labels")
local_nonpersistent_flags+=("--show-labels")
flags+=("--sort-by=")
local_nonpersistent_flags+=("--sort-by=")
flags+=("--template=")
flags_with_completion+=("--template")
flags_completion+=("_filedir")
two_word_flags+=("-t")
flags_with_completion+=("-t")
flags_completion+=("_filedir")
local_nonpersistent_flags+=("--template=")
flags+=("--to-version=")
local_nonpersistent_flags+=("--to-version=")
Expand Down
16 changes: 13 additions & 3 deletions contrib/completions/zsh/oc
Original file line number Diff line number Diff line change
Expand Up @@ -15926,6 +15926,8 @@ _oc_rollback()
flags_with_completion=()
flags_completion=()

flags+=("--allow-missing-template-keys")
local_nonpersistent_flags+=("--allow-missing-template-keys")
flags+=("--change-scaling-settings")
local_nonpersistent_flags+=("--change-scaling-settings")
flags+=("--change-strategy")
Expand All @@ -15935,15 +15937,23 @@ _oc_rollback()
flags+=("--dry-run")
flags+=("-d")
local_nonpersistent_flags+=("--dry-run")
flags+=("--no-headers")
local_nonpersistent_flags+=("--no-headers")
flags+=("--output=")
two_word_flags+=("-o")
local_nonpersistent_flags+=("--output=")
flags+=("--output-version=")
local_nonpersistent_flags+=("--output-version=")
flags+=("--show-all")
flags+=("-a")
local_nonpersistent_flags+=("--show-all")
flags+=("--show-labels")
local_nonpersistent_flags+=("--show-labels")
flags+=("--sort-by=")
local_nonpersistent_flags+=("--sort-by=")
flags+=("--template=")
flags_with_completion+=("--template")
flags_completion+=("_filedir")
two_word_flags+=("-t")
flags_with_completion+=("-t")
flags_completion+=("_filedir")
local_nonpersistent_flags+=("--template=")
flags+=("--to-version=")
local_nonpersistent_flags+=("--to-version=")
Expand Down
14 changes: 7 additions & 7 deletions pkg/oc/cli/cmd/rollout/latest.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var (
# Start a new rollout based on the latest images defined in the image change triggers.
%[1]s rollout latest dc/nginx
# Print the deployment config that would be rolled out in JSON format, without performing the rollout.
# Print the rolled out deployment config
%[1]s rollout latest dc/nginx -o json`)
)

Expand Down Expand Up @@ -128,9 +128,11 @@ func (o *RolloutLatestOptions) Complete(f *clientcmd.Factory, cmd *cobra.Command
o.output = kcmdutil.GetFlagString(cmd, "output")
o.again = kcmdutil.GetFlagBool(cmd, "again")

o.printer, err = f.PrinterForOptions(kcmdutil.ExtractCmdPrintOptions(cmd, false))
if err != nil {
return err
if o.output != "revision" {
o.printer, err = f.PrinterForOptions(kcmdutil.ExtractCmdPrintOptions(cmd, false))
if err != nil {
return err
}
}

return nil
Expand Down Expand Up @@ -196,9 +198,7 @@ func (o RolloutLatestOptions) RunRolloutLatest() error {
if o.output == "revision" {
fmt.Fprintf(o.out, fmt.Sprintf("%d", dc.Status.LatestVersion))
return nil
}

if len(o.output) > 0 {
} else if len(o.output) > 0 {
return o.printer.PrintObj(dc, o.out)
}

Expand Down

0 comments on commit 5428dd7

Please sign in to comment.