From 4b6c682b2d6660ed3975b0cfaefdba0712b34489 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Tue, 26 Feb 2019 09:20:21 +0100 Subject: [PATCH] functions/fish_update_completions: Let the python parse options This did `argparse`, but only handled "--help". Any other options would be ignored. Instead, we just pass all the options through to python, and that'll display help if needed. This allows passing e.g. `--verbose 1` to help with debugging. [ci skip] --- share/functions/fish_update_completions.fish | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/share/functions/fish_update_completions.fish b/share/functions/fish_update_completions.fish index 014a5a9cd..b31ab703c 100644 --- a/share/functions/fish_update_completions.fish +++ b/share/functions/fish_update_completions.fish @@ -1,15 +1,7 @@ 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_data_dir/tools/create_manpage_completions.py --manpath --cleanup-in '~/.config/fish/completions' --cleanup-in '~/.config/fish/generated_completions' --progress + # Don't write .pyc files, use the manpath, clean up old completions + # display progress. + 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 $argv if command -qs python3 python3 $update_args else if command -qs python2