diff --git a/share/completions/amixer.fish b/share/completions/amixer.fish index 724e3e87c..4ce38fa18 100644 --- a/share/completions/amixer.fish +++ b/share/completions/amixer.fish @@ -1,6 +1,6 @@ set -l cmds 'scontrols scontents controls contents sget sset cset cget set get' complete -c amixer -xa "$cmds" -n "not __fish_seen_subcommand_from $cmds" -complete -c amixer -n '__fish_seen_subcommand_from sset sget get set' -xa "(amixer scontrols | cut --delimiter \' --fields 2)" +complete -c amixer -n '__fish_seen_subcommand_from sset sget get set' -xa "(amixer scontrols | string split -f 2 \')" complete -c amixer -s h -l help -d 'this help' complete -c amixer -s c -l card -r -d 'select the card' diff --git a/share/completions/fuser.fish b/share/completions/fuser.fish index 83463834a..9d1a17023 100644 --- a/share/completions/fuser.fish +++ b/share/completions/fuser.fish @@ -1,7 +1,6 @@ __fish_make_completion_signals for i in $__kill_signals - set number (echo $i | cut -d " " -f 1) - set name (echo $i | cut -d " " -f 2) + string split -f 1,2 " " -- $i | read --line number name complete -c fuser -o $number -d $name complete -c fuser -o $name -d $name end diff --git a/share/completions/journalctl.fish b/share/completions/journalctl.fish index 33e31f20a..eee6e5596 100644 --- a/share/completions/journalctl.fish +++ b/share/completions/journalctl.fish @@ -16,7 +16,7 @@ function __fish_journalctl_is_field end function __fish_journalctl_field_values - set -l token (commandline -t | cut -d"=" -f 1) + set -l token (commandline -t | string split -f1 =) command journalctl -F $token 2>/dev/null | while read value echo $token=$value end diff --git a/share/completions/svn.fish b/share/completions/svn.fish index 022f3f656..4d16ffc98 100644 --- a/share/completions/svn.fish +++ b/share/completions/svn.fish @@ -320,12 +320,12 @@ _svn_cmpl_ svn:keywords -a Id -d 'A compressed summary of all keywords' # # Completions for the 'relocate' subcommand # -_svn_cmpl_ $relocate -xa '( svn info | string match "*URL:*" | cut -d " " -f 2 ) http:// ftp:// svn+ssh:// svn+ssh://(__fish_print_hostnames)' +_svn_cmpl_ $relocate -xa '( svn info | string match "*URL:*" | string split -f2 " ") http:// ftp:// svn+ssh:// svn+ssh://(__fish_print_hostnames)' # # Completions for the 'switch', 'sw' subcommands # -_svn_cmpl_ $switch -l relocate -d 'Relocate via URL-rewriting' -xa '( svn info | string match "*URL:*" | cut -d " " -f 2 ) http:// ftp:// svn+ssh:// svn+ssh://(__fish_print_hostnames)' +_svn_cmpl_ $switch -l relocate -d 'Relocate via URL-rewriting' -xa '( svn info | string match "*URL:*" | string split -f2 " ") http:// ftp:// svn+ssh:// svn+ssh://(__fish_print_hostnames)' # # Completions for the 'status', 'st' subcommands diff --git a/share/completions/tokei.fish b/share/completions/tokei.fish index 48b82e3b1..8ac4d2e73 100644 --- a/share/completions/tokei.fish +++ b/share/completions/tokei.fish @@ -3,7 +3,7 @@ function __fish_tokei_supported_serializations # Expecting a line like: # tokei 10.0.1 compiled with serialization support: cbor, json, yaml - command tokei --help | grep 'with serialization support' | cut -d : -f 2 | string trim | string split ', ' + command tokei --help | grep 'with serialization support' | string split --fields 2 : | string trim | string split ', ' end complete -c tokei -s f -l files -d 'Print out statistics for individual files' diff --git a/share/completions/useradd.fish b/share/completions/useradd.fish index 688a0baa0..63a402190 100644 --- a/share/completions/useradd.fish +++ b/share/completions/useradd.fish @@ -7,7 +7,7 @@ complete -c useradd -s c -l comment -d 'A comment about this user' -r complete -c useradd -s d -l home -d 'Home directory for the new user' -x -a '(__fish_complete_directories)' -complete -c useradd -s G -l groups -d 'Supplementary groups' -xa '(__fish_append , (cut -d : -f 1 /etc/group))' +complete -c useradd -s G -l groups -d 'Supplementary groups' -xa '(__fish_append , (string split -f1 : /etc/group))' complete -c useradd -s h -l help -d 'Display help message and exit' complete -c useradd -s m -l create-home -d 'The user\'s home directory will be created if it does not exist' complete -c useradd -s n -d 'A group having the same name as the user being added to the system will be created by default (when -g is not specified)' @@ -18,5 +18,5 @@ complete -c useradd -s u -l uid -d 'The numerical value of the user\'s ID' -r complete -c useradd -s b -l base-dir -d 'The initial path prefix for a new user\'s home directory' -r -a '(__fish_complete_directories)' complete -c useradd -s e -l expiredate -d 'The date on which the user account is disabled' -r complete -c useradd -s f -l inactive -d 'The number of days after a password has expired before the account will be disabled' -r -complete -c useradd -s g -l gid -d 'The group name or ID for a new user\'s initial group' -x -a '(string match -r "^[^#].*" < /etc/group | cut -d : -f 1,3 | string replace -a ":" \n)' +complete -c useradd -s g -l gid -d 'The group name or ID for a new user\'s initial group' -x -a '(string match -r "^[^#].*" < /etc/group | string split -f1,3 ":" | string join ":" | string replace -a ":" \n)' complete -c useradd -s s -l shell -d 'Name of the new user\'s login shell' -x -a '(string match -r "^[^#].*" < /etc/shells)'