From 3360c134149c770a4e3cec96f4ad19334a278a31 Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Wed, 13 Dec 2023 10:51:49 -0800 Subject: [PATCH] Update update_completions fish function for python argcomplete When using register-python-argcomplete, the target command is the last arg rather than the first. This will pull that value instead. --- assets/default/fish/functions/update_completions.fish | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/assets/default/fish/functions/update_completions.fish b/assets/default/fish/functions/update_completions.fish index f8fcec0..6b54440 100644 --- a/assets/default/fish/functions/update_completions.fish +++ b/assets/default/fish/functions/update_completions.fish @@ -14,6 +14,11 @@ function update_completions --description "Update completions for a command" --a set --local completion_dir "$XDG_CONFIG_HOME" end + if [ "$target_command" = "register-python-argcomplete" ] + echo "Command was py $argv[-1]" + set target_command $argv[-1] + end + set --local completion_path "$completion_dir/$target_command.fish" eval $argv[1..] | tee "$completion_path" | source echo "Completions for $target_command generated, sourced, and stored in $completion_path for future shells" 1>&2