fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Akatsuki Ruicompletions/userdbctl: init (#7667)176e6a9ce

master
1.8 KiB29 linesraw
1# Completions for userdbctl (a part of systemd)
2
3set -l commands_users user groups-of-user
4set -l commands_groups group users-in-group
5set -l commands $commands_users $commands_groups
6set -l services "(userdbctl services | string match -r -- '\S+' | string match -v -- 'SERVICE')"
7
8# Commands
9complete -c userdbctl -f
10complete -c userdbctl -n "not __fish_seen_subcommand_from $commands" -a user -d 'Inspect user'
11complete -c userdbctl -n "not __fish_seen_subcommand_from $commands" -a group -d 'Inspect group'
12complete -c userdbctl -n "not __fish_seen_subcommand_from $commands" -a users-in-group -d 'Show users that are members of specified group(s)'
13complete -c userdbctl -n "not __fish_seen_subcommand_from $commands" -a groups-of-user -d 'Show groups the specified user(s) is a member of'
14complete -c userdbctl -n "not __fish_seen_subcommand_from $commands" -a services -d 'Show enabled database services'
15
16complete -c userdbctl -n "__fish_seen_subcommand_from $commands_users" -a '(__fish_complete_users)'
17complete -c userdbctl -n "__fish_seen_subcommand_from $commands_groups" -a '(__fish_complete_groups)'
18
19# Options
20complete -c userdbctl -s h -l help -d 'Show help'
21complete -c userdbctl -l version -d 'Show version'
22complete -c userdbctl -l no-pager -d 'Do not pipe output into a pager'
23complete -c userdbctl -l no-legend -d 'Do not show the headers and footers'
24complete -c userdbctl -l output -d 'Select output mode' -xa 'classic friendly table json'
25complete -c userdbctl -s j -d 'Equivalent to --output=json'
26complete -c userdbctl -s s -l service -d 'Query the specified service' -xa "$services"
27complete -c userdbctl -l with-nss -d 'Control whether to include glibc NSS data' -xa 'yes no'
28complete -c userdbctl -s N -d 'Do not synthesize or include glibc NSS data'
29complete -c userdbctl -l synthesize -d 'Synthesize root/nobody user' -xa 'yes no'