Skip to content

Commit 290305f

Browse files
authored
Fix positional args usage in kick (#1556)
Signed-off-by: Praveen Rewar <[email protected]>
1 parent 29813b7 commit 290305f

File tree

1 file changed

+8
-2
lines changed
  • cli/pkg/kctrl/cmd/package/repository

1 file changed

+8
-2
lines changed

cli/pkg/kctrl/cmd/package/repository/kick.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func NewKickCmd(o *KickOptions, flagsFactory cmdcore.FlagsFactory) *cobra.Comman
4242
cmd := &cobra.Command{
4343
Use: "kick",
4444
Short: "Trigger reconciliation for repository",
45-
RunE: func(_ *cobra.Command, _ []string) error { return o.Run() },
45+
RunE: func(_ *cobra.Command, args []string) error { return o.Run(args) },
4646
Example: cmdcore.Examples{
4747
cmdcore.Example{"Trigger reconciliation for repository",
4848
[]string{"package", "repository", "kick", "-r", "sample-repo"}},
@@ -70,7 +70,13 @@ func NewKickCmd(o *KickOptions, flagsFactory cmdcore.FlagsFactory) *cobra.Comman
7070
return cmd
7171
}
7272

73-
func (o *KickOptions) Run() error {
73+
func (o *KickOptions) Run(args []string) error {
74+
if o.pkgCmdTreeOpts.PositionalArgs {
75+
if len(args) > 0 {
76+
o.Name = args[0]
77+
}
78+
}
79+
7480
if len(o.Name) == 0 {
7581
return fmt.Errorf("Expected repository name to be non empty")
7682
}

0 commit comments

Comments
 (0)