fish-shell/share/functions/__fish_describe_command.fish
Fabian Homborg 7784a5f23c __fish_describe_command: Remove awk
This is really the only important place we're using it.

See #5553.
2019-03-14 13:23:47 +01:00

11 lines
423 B
Fish

#
# This function is used internally by the fish command completion code
#
function __fish_describe_command -d "Command used to find descriptions for commands"
command -sq apropos; or return
# Some systems could use -s 1,8 here, but FreeBSD doesn't have that.
apropos $argv 2>/dev/null | string replace -rf '^(\S+) \(\S+\)\s+- (.*)' '$1\t$2' \
| string match (string replace -a '*' '\*' -- "$argv")"*"
end