diff --git a/doc_src/cmds/commandline.rst b/doc_src/cmds/commandline.rst index 17db670b7..3473f42c3 100644 --- a/doc_src/cmds/commandline.rst +++ b/doc_src/cmds/commandline.rst @@ -74,9 +74,9 @@ The following options change the way ``commandline`` prints the current commandl **-c** or **--cut-at-cursor** Only print selection up until the current cursor position. - If combined with ``--expand-tokens``, this will print up until the last completed token - excluding the token the cursor is in. + If combined with ``--tokens-expanded``, this will print up until the last completed token - excluding the token the cursor is in. This is typically what you would want for instance in completions. - To get both, use both ``commandline --cut-at-cursor --expand-tokens; commandline --cut-at-cursor --current-token``, + To get both, use both ``commandline --cut-at-cursor --tokens-expanded; commandline --cut-at-cursor --current-token``, or ``commandline -cx; commandline -ct`` for short. **-x** or **tokens-expanded** diff --git a/share/completions/argparse.fish b/share/completions/argparse.fish index 9678533c0..e5400be0e 100644 --- a/share/completions/argparse.fish +++ b/share/completions/argparse.fish @@ -1,5 +1,5 @@ function __fish_argparse_exclusive_args --description 'Helper function to list unused options' - set --local all_tokens (commandline --expand-tokens) + set --local all_tokens (commandline --tokens-expanded) set --erase all_tokens[1] set --local current_token (commandline --current-token) diff --git a/share/completions/j.fish b/share/completions/j.fish index 7b2bf1913..38e12013b 100644 --- a/share/completions/j.fish +++ b/share/completions/j.fish @@ -3,7 +3,7 @@ function __history_completions --argument-names limit set limit 25 end - set -l tokens (commandline --current-process --expand-tokens) + set -l tokens (commandline --current-process --tokens-expanded) history --prefix (commandline) | string replace -r \^$tokens[1]\\s\* "" | head -n$limit end diff --git a/share/completions/lxc.fish b/share/completions/lxc.fish index 0acdbcd28..ecabdb69a 100644 --- a/share/completions/lxc.fish +++ b/share/completions/lxc.fish @@ -1,5 +1,5 @@ function __fish_lxc_no_subcommand -d 'Test if lxc has yet to be given the command' - for i in (commandline --expand-tokens --cut-at-cursor --current-process) + for i in (commandline --tokens-expanded --cut-at-cursor --current-process) if contains -- $i config console copy delete exec file help image info launch list move network pause profile publish remote rename restart restore shell snapshot start stop return 1 end diff --git a/share/completions/qdbus.fish b/share/completions/qdbus.fish index dde65ac7b..1e7ab74d2 100644 --- a/share/completions/qdbus.fish +++ b/share/completions/qdbus.fish @@ -1,5 +1,5 @@ function __fish_qdbus_complete - argparse system 'bus=' literal help -- (commandline --cut-at-cursor --expand-tokens) 2>/dev/null + argparse system 'bus=' literal help -- (commandline --cut-at-cursor --tokens-expanded) 2>/dev/null or return if set -q _flag_help return diff --git a/share/completions/service.fish b/share/completions/service.fish index 4a0f94fb6..5bf53803e 100644 --- a/share/completions/service.fish +++ b/share/completions/service.fish @@ -17,7 +17,7 @@ function __fish_complete_freebsd_service_actions # Use the output of `service -v foo` to retrieve the list of service-specific verbs # Output takes the form "[prefix1 prefix2 ..](cmd1 cmd2 cmd3)" where any combination # of zero or one prefixe(s) and any one command is a valid verb. - set -l service_name (commandline --expand-tokens --cut-at-cursor)[-1] + set -l service_name (commandline --tokens-expanded --cut-at-cursor)[-1] set -l results (service $service_name -v 2>| string match -r '\\[(.*)\\]\\((.*)\\)') set -l prefixes "" (string split '|' -- $results[2]) set -l commands (string split '|' -- $results[3]) diff --git a/share/functions/__fish_seen_argument.fish b/share/functions/__fish_seen_argument.fish index 0b1eec1a7..dce4f057d 100644 --- a/share/functions/__fish_seen_argument.fish +++ b/share/functions/__fish_seen_argument.fish @@ -1,7 +1,7 @@ function __fish_seen_argument --description 'Check whether argument is used' argparse --ignore-unknown 's/short=+' 'o/old=+' 'l/long=+' 'w/windows=+' -- $argv - set --local tokens (commandline --current-process --expand-tokens --cut-at-cursor) + set --local tokens (commandline --current-process --tokens-expanded --cut-at-cursor) set --erase tokens[1] for t in $tokens