Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

man completions: complete fish commands #3762

merged 2 commits into from Jan 25, 2017


Copy link

apropos does not output fish commands so they were not completed.

`apropos` does not output fish commands so they were not completed.
@@ -64,6 +64,9 @@ function __fish_complete_man
print name, sect

# Fish commands are not given by apropos
ls (dirname $__fish_datadir)/fish/man/man1/ ^/dev/null | string replace -r '\.1$' '\tFish command' | string match -r '^'$token'.*'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use ls this way. The "dirname" is also useless - $__fish_datadir is a directory, and is under our control.

Instead make the string replace a bit more complicated - string replace -r '.*/([^/]+)\.1$' '$1\tFish command' -- $files, where $files is set -l files $__fish_datadir/fish/man/man1/*.1.

(At least I think that's how the ".1" should be used. I think fedora gzips our man pages, so the regex potentially would have to handle "1.gz" as well)

Matching the token here should also be superfluous - we do that automatically.

@faho faho added this to the next-minor milestone Jan 24, 2017
@faho faho merged commit ec19159 into fish-shell:master Jan 25, 2017
Copy link

faho commented Jan 25, 2017

Merged, thanks!

@moverest moverest deleted the man-fish-command branch June 9, 2017 21:42
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants