fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
a53db7256
master
1# localization: skip(private) 2 3# uses `whatis` if available to describe a command 4 5function __fish_whatis 6set -l cmd$argv [ 1 ] 7set -l fallback 8if set -q argv[ 2 ] 9set fallback$argv [ 2 ] 10end 11 12set -l description( whatis $cmd 2> /dev/null| string replace -r'.*? - ' '' )[ 1 ] 13if string match -qr --"." " $description " 14printf '%s\n' $description 15return 0 16else if not string match -q --" $fallback " "" 17printf '%s\n' $fallback 18return 0 19else 20return 1 21end 22end