mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-06 10:05:28 +08:00

The completions for the `--example` option are generated using `find`. The `find` utility on macOS will produce the following output when the path argument has a trailing slash: ``` ~/bat $ find ./examples/ ./examples/ ./examples//cat.rs ./examples//advanced.rs ./examples//simple.rs ./examples//list_syntaxes_and_themes.rs ./examples//yaml.rs ``` And will produce this output if the path does NOT have a trailing slash: ``` ~/bat $ find ./examples ./examples ./examples/cat.rs ./examples/advanced.rs ./examples/simple.rs ./examples/list_syntaxes_and_themes.rs ./examples/yaml.rs ``` The extra slash after `examples` ends up in the completion suggestions which is incorrect: ``` ~/bat $ cargo run --example <TAB> /advanced /cat /list_syntaxes_and_themes /simple /yaml ``` Unlike on my Linux box where `find` doesn't output the trailing slash: ``` ~/bat $ cargo run --example <TAB> advanced cat inputs list_syntaxes_and_themes simple yaml ``` Importantly, I get the same (correct) output on Linux even without the trailing slash in the path argument to `find`.