Skip to content

[regression in 4.0] Completion for flags without = no longer seems to work for git subcommands #11205

@PawelLipski

Description

@PawelLipski

I've provided the following completion for my git subcommand (simplified):

function __machete_addable_branches
  echo "Bar"
  echo "Foo"
end

function __machete_managed_branches
  echo "Hello"
  echo "World"
end

complete -c git-machete -f         -a '(__machete_addable_branches)'
complete -c git-machete -x -l onto -a '(__machete_managed_branches)'

In particular, I'm using complete -c git-machete to provide completion for git machete (no hyphen), which I'm not sure if it's canonical 🤔
Still, this worked fine until v3.7.1:

$ fish --version
fish, version 3.7.1

$ complete -C "git machete "
Bar
Foo

$ complete -C "git machete --onto "
Hello
World

$ complete -C "git machete --onto="
--onto=Hello
--onto=World

However, I've noticed a regression in v4.0.0: the case for a flag without = suggests the completion for the entire command instead of for the flag:

$ fish --version
fish, version 4.0.0

$ complete -C "git machete --onto "
Bar
Foo

Behavior for other cases above is identical under 3.7.1 and 4.0.0.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions