completions hostnamectl: updated to systemd 251

This commit is contained in:
exploide 2022-11-27 11:24:23 +01:00 committed by Mahmoud Al-Qudsi
parent 063450b8f4
commit e4cde861a4

View file

@ -1,18 +1,31 @@
set -l commands status set-hostname set-icon-name set-chassis set-deployment set-location
complete -c hostnamectl -f
complete -c hostnamectl -n "not __fish_seen_subcommand_from $commands" -a status -d 'Show current hostname settings'
complete -c hostnamectl -n "not __fish_seen_subcommand_from $commands" -a set-hostname -d 'Set system hostname'
complete -c hostnamectl -n "not __fish_seen_subcommand_from $commands" -a set-icon-name -d 'Set icon name for host'
complete -c hostnamectl -n "not __fish_seen_subcommand_from $commands" -a set-chassis -d 'Set chassis type for host'
complete -c hostnamectl -n "not __fish_seen_subcommand_from $commands" -a set-deployment -d 'Set deployment environment for host'
complete -c hostnamectl -n "not __fish_seen_subcommand_from $commands" -a set-location -d 'Set location for host'
complete -c hostnamectl -s h -l help -d 'Show this help'
complete -c hostnamectl -l version -d 'Show package version'
complete -c hostnamectl -l no-ask-password -d 'Do not prompt for password'
complete -c hostnamectl -s H -l host -r -d 'Operate on remote HOST'
complete -c hostnamectl -s M -l machine -r -d 'Operate on local CONTAINER'
complete -c hostnamectl -l transient -d 'Only set transient hostname'
complete -c hostnamectl -l static -d 'Only set static hostname'
complete -c hostnamectl -l pretty -d 'Only set pretty hostname'
set -l __hostnamectl_version $(hostnamectl --version &| string match -rg 'systemd (\d+).*')
if test "$__hostnamectl_version" -lt 249
complete -c hostnamectl -n "__fish_use_subcommand" -xa "status\t'Show hostname and related info'
set-hostname\t'Set hostname'
set-icon-name\t'Set icon name'
set-chassis\t'Set chassis type'
set-deployment\t'Set deployment environment'
set-location\t'Set location'"
else
complete -c hostnamectl -n "__fish_use_subcommand" -xa "status\t'Show hostname and related info'
hostname\t'Get or set hostname'
icon-name\t'Get or set icon name'
chassis\t'Get or set chassis type'
deployment\t'Get or set deployment environment'
location\t'Get or set location'"
end
complete -c hostnamectl -n "__fish_seen_subcommand_from set-chassis chassis" -xa "desktop laptop convertible server tablet handset watch embedded vm container"
complete -c hostnamectl -n "__fish_seen_subcommand_from set-deployment deployment" -xa "development integration staging production"
complete -c hostnamectl -l no-ask-password -d "Don't query for authentication for privileged operations"
complete -c hostnamectl -l static -d "Get or set static hostname"
complete -c hostnamectl -l transient -d "Get or set transient hostname"
complete -c hostnamectl -l pretty -d "Get or set pretty hostname"
complete -c hostnamectl -s H -l host -x -d "Execute operation on remote host"
complete -c hostnamectl -s M -l machine -x -d "Execute operation on local container"
complete -c hostnamectl -s h -l help -d "Print short help"
complete -c hostnamectl -l version -d "Print version"
complete -c hostnamectl -l json -d "Show output as JSON" -xa "short pretty off"