2012-04-12 10:05:43 +08:00
|
|
|
function fish_update_completions --description "Update man-page based completions"
|
2017-10-12 21:00:50 +08:00
|
|
|
set -l options 'h/help'
|
|
|
|
argparse -n open --min-args=0 $options -- $argv
|
|
|
|
or return
|
|
|
|
|
|
|
|
if set -q _flag_help
|
|
|
|
__fish_print_help fish_update_completions
|
|
|
|
return 0
|
|
|
|
end
|
|
|
|
|
2016-11-28 13:27:22 +08:00
|
|
|
# Clean up old paths
|
2018-03-12 21:34:20 +08:00
|
|
|
set -l update_args -B $__fish_data_dir/tools/create_manpage_completions.py --manpath --cleanup-in '~/.config/fish/completions' --cleanup-in '~/.config/fish/generated_completions' --progress
|
2017-04-20 19:35:20 +08:00
|
|
|
if command -qs python3
|
|
|
|
python3 $update_args
|
|
|
|
else if command -qs python2
|
|
|
|
python2 $update_args
|
|
|
|
else if command -qs python
|
|
|
|
python $update_args
|
2017-10-12 21:00:50 +08:00
|
|
|
else
|
|
|
|
printf "%s\n" (_ "python executable not found")
|
|
|
|
return 1
|
2017-04-20 19:35:20 +08:00
|
|
|
end
|
2012-04-12 10:05:43 +08:00
|
|
|
end
|