Skip to content

Commit

Permalink
Merge pull request #621 from rsteube/fix-dash-completion
Browse files Browse the repository at this point in the history
fix dash completion
  • Loading branch information
rsteube committed Nov 27, 2022
2 parents c560fad + ac00206 commit df4ffd8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion complete.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ func complete(cmd *cobra.Command, args []string) (string, error) {
}

if common.IsDash(targetCmd) {
targetAction = findAction(targetCmd, targetArgs[targetCmd.ArgsLenAtDash():])
dashArgs := targetArgs[targetCmd.ArgsLenAtDash() : len(targetArgs)-1]
context.Args = dashArgs
targetAction = findAction(targetCmd, dashArgs)
} else {
targetAction = findAction(targetCmd, targetArgs)
if targetCmd.HasAvailableSubCommands() && len(targetArgs) <= 1 {
Expand Down

0 comments on commit df4ffd8

Please sign in to comment.