fish_update_completions: use status get-file instead of temp files

This helps the next commit.
This commit is contained in:
Johannes Altmanninger
2025-10-26 21:43:25 +01:00
parent 07e26518fc
commit e7dc1c4635

View File

@@ -5,25 +5,19 @@ function fish_update_completions --description "Update man-page based completion
return 1
end
function __fish_update_completions -V python
set -l user_args $argv[..-2]
set -l tools $argv[-1]
set -l update_args \
# Don't write .pyc files.
-B \
$tools/create_manpage_completions.py \
# Use the manpath
--manpath \
# Clean up old completions
--cleanup-in $__fish_user_data_dir/generated_completions \
--cleanup-in $__fish_cache_dir/generated_completions \
# Display progress
--progress \
$user_args
set -l update_args \
# Don't write .pyc files.
-B \
$tools/create_manpage_completions.py \
# Use the manpath
--manpath \
# Clean up old completions
--cleanup-in $__fish_user_data_dir/generated_completions \
--cleanup-in $__fish_cache_dir/generated_completions \
# Display progress
--progress \
$argv
__fish_data_with_file tools/create_manpage_completions.py cat |
$python $update_args
end
__fish_data_with_directory tools \
'create_manpage_completions\.py' \
__fish_update_completions $argv
__fish_with_status functions --erase __fish_update_completions
end