Skip to content

Commit

Permalink
Add completions for namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
chmouel committed Nov 24, 2022
1 parent 6a9414b commit 9e010b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/cmd/tknpac/deleterepo/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ func repositoryCommand(run *params.Run, ioStreams *cli.IOStreams) *cobra.Command

cmd.Flags().StringP(
namespaceFlag, "n", "", "If present, the namespace scope for this CLI request")
_ = cmd.RegisterFlagCompletionFunc(namespaceFlag,
func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return completion.BaseCompletion(namespaceFlag, args)
},
)

cmd.Flags().BoolVarP(
&cascade, "cascade", "c", false, "Delete the repository and its secrets attached to it")
Expand Down
5 changes: 5 additions & 0 deletions pkg/cmd/tknpac/logs/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ func Command(run *params.Run, ioStreams *cli.IOStreams) *cobra.Command {

cmd.Flags().StringP(
namespaceFlag, "n", "", "If present, the namespace scope for this CLI request")
_ = cmd.RegisterFlagCompletionFunc(namespaceFlag,
func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return completion.BaseCompletion(namespaceFlag, args)
},
)

cmd.Flags().BoolP(
openWebBrowserFlag, "w", false, "Open Web browser to detected console instead of using tkn")
Expand Down

0 comments on commit 9e010b7

Please sign in to comment.