From 472d7efe344e37a15ba51c565c3983868375c016 Mon Sep 17 00:00:00 2001 From: David Adam Date: Tue, 4 Jul 2023 23:32:39 +0800 Subject: [PATCH] completions/status: add basename and dirname --- share/completions/status.fish | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/completions/status.fish b/share/completions/status.fish index b10c8db9a..8b415c80e 100644 --- a/share/completions/status.fish +++ b/share/completions/status.fish @@ -1,5 +1,5 @@ # Note that when a completion file is sourced a new block scope is created so `set -l` works. -set -l __fish_status_all_commands current-command current-commandline current-filename current-function current-line-number features filename fish-path function is-block is-breakpoint is-command-substitution is-full-job-control is-interactive is-interactive-job-control is-login is-no-job-control job-control line-number print-stack-trace stack-trace test-feature +set -l __fish_status_all_commands basename current-command current-commandline current-filename current-function current-line-number dirname features filename fish-path function is-block is-breakpoint is-command-substitution is-full-job-control is-interactive is-interactive-job-control is-login is-no-job-control job-control line-number print-stack-trace stack-trace test-feature # These are the recognized flags. complete -c status -s h -l help -d "Display help and exit" @@ -19,6 +19,8 @@ complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_com complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a current-commandline -d "Print the currently running command with its arguments" complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a current-filename -d "Print the filename of the currently running script" complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a filename -d "Print the filename of the currently running script" +complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a basename -d "Print the file name (without the path) of the currently running script" +complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a dirname -d "Print the path (without the file name) of the currently running script" complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a current-function -d "Print the name of the current function" complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a function -d "Print the name of the current function" complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a current-line-number -d "Print the line number of the currently running script"