fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
6d0cd3d9b
master
1function fish_update_completions --description"Update man-page based completions" 2set -l detach false 3if test " $fish_update_completions_detach " = true 4set detach true 5end 6set -l python( __fish_anypython ) 7or begin 8printf "%s\n" ( _ "python executable not found" ) >&2 9return 1 10end 11 12set -l update_argv\ 13$python \ 14# Don't write .pyc files. 15-B \ 16 -\ 17# Use the manpath 18--manpath \ 19 --directory=$__fish_cache_dir /generated_completions\ 20# Clean up old completions 21--cleanup-in $__fish_user_data_dir /generated_completions 22 23status get-file tools/create_manpage_completions.py| 24if $detach 25# Run python directly in the background and swallow all output 26# Orphan the job so that it continues to run in case of an early exit (#6269) 27# Note that some distros split the manpage completion script out (#7183). 28# In that case, we silence Python's failure. 29set -l sh( __fish_posix_shell ) 30$sh -c' 31c=$(cat) 32( printf %s "$c" | "$@" ) >/dev/null 2>&1 & 33' --$update_argv $argv 34else 35# Display progress 36$update_argv --progress$argv 37end 38end