Merge pull request #30575 from arthurzam/bash

bash-completion: add some missing options
This commit is contained in:
Luca Boccassi 2023-12-21 23:44:17 +01:00 committed by GitHub
commit eb2afc75e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 4 deletions

View file

@ -30,7 +30,7 @@ _systemd_cat() {
local -A OPTS=(
[STANDALONE]='-h --help --version'
[ARG]='-t --identifier -p --priority --level-prefix'
[ARG]='-t --identifier -p --priority --stderr-priority --level-prefix'
)
_init_completion || return
@ -40,7 +40,7 @@ _systemd_cat() {
--identifier|-t)
comps=''
;;
--priority|-p)
--priority|-p|--stderr-priority)
comps='emerg alert crit err warning notice info debug'
;;
--level-prefix)

View file

@ -44,7 +44,7 @@ _systemd_cgls() {
local -A OPTS=(
[STANDALONE]='-h --help --version --all -l --full -k --no-pager --xattr=no --cgroup-id=no'
[ARG]='-M --machine -u --unit --user-unit'
[ARG]='-c --cgroup-id -M --machine -u --unit --user-unit -x --xattr'
)
_init_completion || return
@ -57,6 +57,9 @@ _systemd_cgls() {
--unit|-u)
comps=$( __get_units_have_cgroup --system )
;;
-c|--cgroup-id|-x|--xattr)
comps='yes no'
;;
--user-unit)
comps=$( __get_units_have_cgroup --user )
;;

View file

@ -30,9 +30,12 @@ _systemd-confext() {
[STANDALONE]='-h --help --version
--no-pager
--no-legend
--no-reload
--force'
[ARG]='--root
--json'
--json
--noexec
--image-policy'
)
local -A VERBS=(
@ -54,6 +57,12 @@ _systemd-confext() {
--json)
comps='pretty short off'
;;
--noexec)
comps='false true'
;;
--image-policy)
comps=''
;;
esac
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
return 0