Skip to content

Commit

Permalink
fix dash completion
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Nov 27, 2022
1 parent c560fad commit ac00206
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 ac00206

Please sign in to comment.