man completions: complete fish commands#3762
Merged
Merged
Conversation
`apropos` does not output fish commands so they were not completed.
faho
requested changes
Jan 24, 2017
| ' | ||
|
|
||
| # 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'.*' |
Member
There was a problem hiding this comment.
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.
Member
|
Merged, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
aproposdoes not output fish commands so they were not completed.