Improved fish shell completion with filename parameters #3644
Labels
A-completion
Area: completion generator
C-bug
Category: Updating dependencies
E-easy
Call for participation: Experience needed to fix: Easy / not much
Please complete the following tasks
Rust Version
rustc 1.60.0 (7737e0b5c 2022-04-04)
Clap Version
3.1.10
Minimal reproducible code
Any program which writes fish completions, has a file path as a unordered argument, and has subcommands.
Steps to reproduce the bug with the above code
cargo run -- generate > ~/.config/fish/completions/<cargo project name>.fish
Actual Behaviour
When trying to complete now, files aren't completed as you'd expect. Fish expects the first argument to be a subcommand, but it can also be a file.
Expected Behaviour
Fish should complete both subcommands and files.
This was solved by prepending the following to the top of the completion file, where
chute
is my binary name:This could be done if a file path argument exists and we have subcommands.
Additional Context
No response
Debug Output
No response
The text was updated successfully, but these errors were encountered: