mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
apropos completions for macOS/BSD variants
This should show the correct options for macOS, NetBSD, FreeBSD, OpenBSD, and DragonFly.
This commit is contained in:
parent
c887e5dbde
commit
a6e2e52eef
2 changed files with 56 additions and 16 deletions
|
@ -10,6 +10,7 @@ end
|
|||
|
||||
complete -xc apropos -a '(__fish_complete_apropos)' -d "whatis entry"
|
||||
|
||||
if apropos --version &>/dev/null
|
||||
complete -f -c apropos -s '?' -l help -d "Display help and exit"
|
||||
complete -f -c apropos -l usage -d "Display short usage message"
|
||||
complete -f -c apropos -s d -l debug -d "Print debugging info"
|
||||
|
@ -25,3 +26,43 @@ complete -f -c apropos -s a -l and -d "Match all keywords"
|
|||
complete -f -c apropos -s l -l long -d "Do not trim output to terminal width"
|
||||
complete -x -c apropos -s s -l sections -l section -d "Search only these sections (colon-separated)"
|
||||
complete -x -c apropos -s L -l locale -a "(command -sq locale; and locale -a)" -d "Set locale"
|
||||
else
|
||||
set -l uname (uname -s)
|
||||
complete apropos -s s -d 'specify manual section' -x # common option
|
||||
|
||||
contains $uname Darwin
|
||||
and complete apropos -s d -d "print debug info" -f
|
||||
|
||||
if contains $uname FreeBSD DragonFlyBSD OpenBSD NetBSD
|
||||
complete apropos -s C -d "specify man config file" -r
|
||||
complete apropos -s S -d "search for given arch" -f
|
||||
end
|
||||
|
||||
if contains $uname FreeBSD DragonFlyBSD OpenBSD
|
||||
complete apropos -s a -d "print complete manual pages" -f
|
||||
complete apropos -s m -d "prepend extra paths to find db" -r
|
||||
complete apropos -s M -d "specify paths to search for db" -r
|
||||
complete apropos -s k -d "full expression syntax (default)" -f
|
||||
complete apropos -s f -d "only match whole words, in titles" -f
|
||||
complete apropos -s O -d "show values associated given key" -x
|
||||
else if contains $uname NetBSD
|
||||
complete apropos -s1 -d "search section 1" -f
|
||||
complete apropos -s2 -d "search section 2" -f
|
||||
complete apropos -s3 -d "search section 3" -f
|
||||
complete apropos -s4 -d "search section 4" -f
|
||||
complete apropos -s5 -d "search section 5" -f
|
||||
complete apropos -s6 -d "search section 6" -f
|
||||
complete apropos -s7 -d "search section 7" -f
|
||||
complete apropos -s8 -d "search section 8" -f
|
||||
complete apropos -s9 -d "search section 9" -f
|
||||
complete apropos -s h -d "HTML formatting" -f
|
||||
complete apropos -s i -d "terminal escape formatting" -f
|
||||
complete apropos -s s -d "disable context, formatting" -f
|
||||
complete apropos -s m -d "show match context (default)" -f
|
||||
complete apropos -s M -d "do not show match context" -f
|
||||
complete apropos -s n -d "limit number of results" -f
|
||||
complete apropos -s P -d "format for pager" -f
|
||||
complete apropos -s p -d "format & pipe through pager" -f
|
||||
complete apropos -s r -d "disable formatting" -f
|
||||
end
|
||||
end
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
complete -xc man -a "(__fish_complete_man)"
|
||||
|
||||
complete -xc man -n 'not __fish_complete_man' -a 1 -d 'Program section'
|
||||
|
|
Loading…
Reference in a new issue