Skip to content

man completions: complete fish commands#3762

Merged
faho merged 2 commits into
fish-shell:masterfrom
moverest:man-fish-command
Jan 25, 2017
Merged

man completions: complete fish commands#3762
faho merged 2 commits into
fish-shell:masterfrom
moverest:man-fish-command

Conversation

@moverest
Copy link
Copy Markdown
Contributor

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

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

# 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
Copy Markdown
Member

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
@faho
Copy link
Copy Markdown
Member

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants