Skip to content

Commit 9e010b7

Browse files
committed
Add completions for namespaces
1 parent 6a9414b commit 9e010b7

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

pkg/cmd/tknpac/deleterepo/delete.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ func repositoryCommand(run *params.Run, ioStreams *cli.IOStreams) *cobra.Command
5959

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

6368
cmd.Flags().BoolVarP(
6469
&cascade, "cascade", "c", false, "Delete the repository and its secrets attached to it")

pkg/cmd/tknpac/logs/logs.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ func Command(run *params.Run, ioStreams *cli.IOStreams) *cobra.Command {
125125

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

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

0 commit comments

Comments
 (0)