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
merged 2 commits into from Jan 25, 2017

Conversation

Projects
None yet
2 participants
@moverest
Copy link
Contributor

moverest commented Jan 22, 2017

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

man completions: complete fish commands
`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'.*'

This comment has been minimized.

@faho

faho Jan 24, 2017

Member

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

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
@faho

This comment has been minimized.

Copy link
Member

faho commented Jan 25, 2017

Merged, thanks!

@moverest moverest deleted the moverest:man-fish-command branch Jun 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment