Skip to content

Commit

Permalink
fix(root cmd): only args after double dash is command
Browse files Browse the repository at this point in the history
  • Loading branch information
sunggun-yu committed Feb 15, 2022
1 parent c3fff86 commit a68e9ed
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ func rootCommand() *cobra.Command {
case cmd.ArgsLenAtDash() == 0:
profile, err = Config.DefaultProfile()
command = args
case cmd.ArgsLenAtDash() == 1:
case cmd.ArgsLenAtDash() > 0:
profile, err = Config.Profiles.FindProfile(args[0])
command = args[1:]
// only args after double dash "--"" should be considered as command
command = args[cmd.ArgsLenAtDash():]
}
if err != nil {
checkErrorAndPrintCommandExample(cmd, err)
Expand Down

0 comments on commit a68e9ed

Please sign in to comment.