mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-11 07:34:32 +00:00
fish_update_completions: error when python not found (#4454)
This commit is contained in:
parent
6d350409b3
commit
649e244092
1 changed files with 12 additions and 0 deletions
|
@ -1,4 +1,13 @@
|
|||
function fish_update_completions --description "Update man-page based completions"
|
||||
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
|
||||
|
||||
# Clean up old paths
|
||||
set -l update_args -B $__fish_datadir/tools/create_manpage_completions.py --manpath --cleanup-in '~/.config/fish/completions' --cleanup-in '~/.config/fish/generated_completions' --progress
|
||||
if command -qs python3
|
||||
|
@ -7,5 +16,8 @@ function fish_update_completions --description "Update man-page based completion
|
|||
python2 $update_args
|
||||
else if command -qs python
|
||||
python $update_args
|
||||
else
|
||||
printf "%s\n" (_ "python executable not found")
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue