more dogfood

This commit is contained in:
Jason Nader 2020-03-31 11:32:31 +09:00 committed by Fabian Homborg
parent eaf313f755
commit 30459b053f
6 changed files with 8 additions and 9 deletions

View File

@ -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'

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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'

View File

@ -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)'