chiark / gitweb /
docs: gtk-doc warnings are annoying
[elogind.git] / shell-completion / systemd-bash-completion.sh
1 # This file is part of systemd.
2 #
3 # Copyright 2010 Ran Benita
4 #
5 # systemd is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU Lesser General Public License as published by
7 # the Free Software Foundation; either version 2.1 of the License, or
8 # (at your option) any later version.
9 #
10 # systemd is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
17
18 __systemctl() {
19         systemctl --full --no-legend "$@"
20 }
21
22 __contains_word () {
23         local word=$1; shift
24         for w in $*; do [[ $w = $word ]] && return 0; done
25         return 1
26 }
27
28 __filter_units_by_property () {
29         local property=$1 value=$2 ; shift 2
30         local units=("$@")
31         local props
32         IFS=$'\n' read -rd '' -a props < \
33             <(__systemctl show --property "$property" -- "${units[@]}")
34         for ((i=0; $i < ${#units[*]}; i++)); do
35                 if [[ "${props[i]}" = "$property=$value" ]]; then
36                         printf "%s\n" "${units[i]}"
37                 fi
38         done
39 }
40
41 __get_all_units      () { __systemctl list-units --all \
42         | { while read -r a b; do printf "%s\n" "$a"; done; }; }
43 __get_active_units   () { __systemctl list-units       \
44         | { while read -r a b; do printf "%s\n" "$a"; done; }; }
45 __get_inactive_units () { __systemctl list-units --all \
46         | { while read -r a b c d; do [[ $c == "inactive" ]] && printf "%s\n" "$a"; done; }; }
47 __get_failed_units   () { __systemctl list-units       \
48         | { while read -r a b c d; do [[ $c == "failed"   ]] && printf "%s\n" "$a"; done; }; }
49 __get_enabled_units  () { __systemctl list-unit-files  \
50         | { while read -r a b c  ; do [[ $b == "enabled"  ]] && printf "%s\n" "$a"; done; }; }
51 __get_disabled_units () { __systemctl list-unit-files  \
52         | { while read -r a b c  ; do [[ $b == "disabled" ]] && printf "%s\n" "$a"; done; }; }
53 __get_masked_units   () { __systemctl list-unit-files  \
54         | { while read -r a b c  ; do [[ $b == "masked"   ]] && printf "%s\n" "$a"; done; }; }
55
56 _systemctl () {
57         local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
58         local i verb comps
59
60         local -A OPTS=(
61                [STANDALONE]='--all -a --defaults --fail --ignore-dependencies --failed --force -f --full --global
62                              --help -h --no-ask-password --no-block --no-legend --no-pager --no-reload --no-wall
63                              --order --require --quiet -q --privileged -P --system --user --version --runtime'
64                       [ARG]='--host -H --kill-mode --kill-who --property -p --signal -s --type -t --root'
65         )
66
67         if __contains_word "$prev" ${OPTS[ARG]}; then
68                 case $prev in
69                         --signal|-s)
70                                 comps=$(compgen -A signal)
71                         ;;
72                         --type|-t)
73                                 comps='automount device mount path service snapshot socket swap target timer'
74                         ;;
75                         --kill-who)
76                                 comps='all control main'
77                         ;;
78                         --kill-mode)
79                                 comps='control-group process'
80                         ;;
81                         --root)
82                                 comps=$(compgen -A directory -- "$cur" )
83                                 compopt -o filenames
84                         ;;
85                         --host|-H)
86                                 comps=$(compgen -A hostname)
87                         ;;
88                         --property|-p)
89                                 comps=''
90                         ;;
91                 esac
92                 COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
93                 return 0
94         fi
95
96
97         if [[ "$cur" = -* ]]; then
98                 COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
99                 return 0
100         fi
101
102         local -A VERBS=(
103                 [ALL_UNITS]='is-active is-enabled status show mask preset'
104             [ENABLED_UNITS]='disable reenable'
105            [DISABLED_UNITS]='enable'
106              [FAILED_UNITS]='reset-failed'
107           [STARTABLE_UNITS]='start'
108           [STOPPABLE_UNITS]='stop condstop kill try-restart condrestart'
109          [ISOLATABLE_UNITS]='isolate'
110          [RELOADABLE_UNITS]='reload condreload reload-or-try-restart force-reload'
111         [RESTARTABLE_UNITS]='restart reload-or-restart'
112              [MASKED_UNITS]='unmask'
113                      [JOBS]='cancel'
114                 [SNAPSHOTS]='delete'
115                      [ENVS]='set-environment unset-environment'
116                [STANDALONE]='daemon-reexec daemon-reload default dot dump
117                              emergency exit halt kexec list-jobs list-units
118                              list-unit-files poweroff reboot rescue show-environment'
119                      [NAME]='snapshot load'
120                      [FILE]='link'
121         )
122
123         for ((i=0; $i <= $COMP_CWORD; i++)); do
124                 if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]} &&
125                  ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
126                         verb=${COMP_WORDS[i]}
127                         break
128                 fi
129         done
130
131         if   [[ -z $verb ]]; then
132                 comps="${VERBS[*]}"
133
134         elif __contains_word "$verb" ${VERBS[ALL_UNITS]}; then
135                 comps=$( __get_all_units )
136
137         elif __contains_word "$verb" ${VERBS[ENABLED_UNITS]}; then
138                 comps=$( __get_enabled_units )
139
140         elif __contains_word "$verb" ${VERBS[DISABLED_UNITS]}; then
141                 comps=$( __get_disabled_units )
142
143         elif __contains_word "$verb" ${VERBS[STARTABLE_UNITS]}; then
144                 comps=$( __filter_units_by_property CanStart yes \
145                       $( __get_inactive_units \
146                         | while read -r line; do \
147                                 [[ "$line" =~ \.(device|snapshot)$ ]] || printf "%s\n" "$line"; \
148                         done ))
149
150         elif __contains_word "$verb" ${VERBS[RESTARTABLE_UNITS]}; then
151                 comps=$( __filter_units_by_property CanStart yes \
152                       $( __get_all_units \
153                         | while read -r line; do \
154                                 [[ "$line" =~ \.(device|snapshot|socket|timer)$ ]] || printf "%s\n" "$line"; \
155                         done ))
156
157         elif __contains_word "$verb" ${VERBS[STOPPABLE_UNITS]}; then
158                 comps=$( __filter_units_by_property CanStop yes \
159                       $( __get_active_units ) )
160
161         elif __contains_word "$verb" ${VERBS[RELOADABLE_UNITS]}; then
162                 comps=$( __filter_units_by_property CanReload yes \
163                       $( __get_active_units ) )
164
165         elif __contains_word "$verb" ${VERBS[ISOLATABLE_UNITS]}; then
166                 comps=$( __filter_units_by_property AllowIsolate yes \
167                       $( __get_all_units ) )
168
169         elif __contains_word "$verb" ${VERBS[FAILED_UNITS]}; then
170                 comps=$( __get_failed_units )
171
172         elif __contains_word "$verb" ${VERBS[MASKED_UNITS]}; then
173                 comps=$( __get_masked_units )
174
175         elif __contains_word "$verb" ${VERBS[STANDALONE]} ${VERBS[NAME]}; then
176                 comps=''
177
178         elif __contains_word "$verb" ${VERBS[JOBS]}; then
179                 comps=$( __systemctl list-jobs | { while read -r a b; do printf "%s\n" "$a"; done; } )
180
181         elif __contains_word "$verb" ${VERBS[SNAPSHOTS]}; then
182                 comps=$( __systemctl list-units --type snapshot --full --all \
183                         | { while read -r a b; do printf "%s\n" "$a"; done; } )
184
185         elif __contains_word "$verb" ${VERBS[ENVS]}; then
186                 comps=$( __systemctl show-environment \
187                     | while read -r line; do printf "%s\n" "${line%%=*}=";done )
188                 compopt -o nospace
189
190         elif __contains_word "$verb" ${VERBS[FILE]}; then
191                 comps=$( compgen -A file -- "$cur" )
192                 compopt -o filenames
193         fi
194
195         COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
196         return 0
197 }
198 complete -F _systemctl systemctl
199
200 __get_all_sessions () { loginctl list-sessions | { while read -r a b; do printf "%s\n" "$a"; done; } ; }
201 __get_all_users    () { loginctl list-users    | { while read -r a b; do printf "%s\n" "$b"; done; } ; }
202 __get_all_seats    () { loginctl list-seats    | { while read -r a b; do printf "%s\n" "$a"; done; } ; }
203
204 _loginctl () {
205         local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
206         local i verb comps
207
208         local -A OPTS=(
209                [STANDALONE]='--all -a --help -h --no-pager --privileged -P --version'
210                       [ARG]='--host -H --kill-who --property -p --signal -s'
211         )
212
213         if __contains_word "$prev" ${OPTS[ARG]}; then
214                 case $prev in
215                         --signal|-s)
216                                 comps=$(compgen -A signal)
217                         ;;
218                         --kill-who)
219                                 comps='all leader'
220                         ;;
221                         --host|-H)
222                                 comps=$(compgen -A hostname)
223                         ;;
224                         --property|-p)
225                                 comps=''
226                         ;;
227                 esac
228                 COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
229                 return 0
230         fi
231
232
233         if [[ "$cur" = -* ]]; then
234                 COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
235                 return 0
236         fi
237
238         local -A VERBS=(
239                 [SESSIONS]='session-status show-session activate lock-session unlock-session terminate-session kill-session'
240                 [USERS]='user-status show-user enable-linger disable-linger terminate-user kill-user'
241                 [SEATS]='seat-status show-seat terminate-seat'
242                 [STANDALONE]='list-sessions list-users list-seats flush-devices'
243                 [ATTACH]='attach'
244         )
245
246         for ((i=0; $i <= $COMP_CWORD; i++)); do
247                 if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]} &&
248                  ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
249                         verb=${COMP_WORDS[i]}
250                         break
251                 fi
252         done
253
254         if   [[ -z $verb ]]; then
255                 comps="${VERBS[*]}"
256
257         elif __contains_word "$verb" ${VERBS[SESSIONS]}; then
258                 comps=$( __get_all_sessions )
259
260         elif __contains_word "$verb" ${VERBS[USERS]}; then
261                 comps=$( __get_all_users )
262
263         elif __contains_word "$verb" ${VERBS[SEATS]}; then
264                 comps=$( __get_all_seats )
265
266         elif __contains_word "$verb" ${VERBS[STANDALONE]}; then
267                 comps=''
268
269         elif __contains_word "$verb" ${VERBS[ATTACH]}; then
270                 if [[ $prev = $verb ]]; then
271                         comps=$( __get_all_seats )
272                 else
273                         comps=$(compgen -A file -- "$cur" )
274                         compopt -o filenames
275                 fi
276         fi
277
278         COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
279         return 0
280 }
281 complete -F _loginctl loginctl
282
283 __journal_fields=(MESSAGE{,_ID} PRIORITY CODE_{FILE,LINE,FUNC}
284                   ERRNO SYSLOG_{FACILITY,IDENTIFIER,PID}
285                   _{P,U,G}ID _COMM _EXE _CMDLINE
286                   _AUDIT_{SESSION,LOGINUID}
287                   _SYSTEMD_{CGROUP,SESSION,UNIT,OWNER_UID}
288                   _SELINUX_CONTEXT _SOURCE_REALTIME_TIMESTAMP
289                   _{BOOT,MACHINE}_ID _HOSTNAME _TRANSPORT
290                   _KERNEL_{DEVICE,SUBSYSTEM}
291                   _UDEV_{SYSNAME,DEVNODE,DEVLINK}
292                   __CURSOR __{REALTIME,MONOTONIC}_TIMESTAMP)
293
294 _journalctl() {
295         local field_vals= cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
296         local -A OPTS=(
297                 [STANDALONE]='-a --all -b --this-boot --disk-usage -f --follow --header
298                               -h --help -l --local --new-id128 -m --merge --no-pager
299                               --no-tail -q --quiet --setup-keys --this-boot --verify
300                               --version'
301                        [ARG]='-D --directory -F --field -o --output -u --unit'
302                 [ARGUNKNOWN]='-c --cursor --interval -n --lines -p --priority --since --until
303                               --verify-key'
304         )
305
306         if __contains_word "$prev" ${OPTS[ARG]} ${OPTS[ARGUNKNOWN]}; then
307                 case $prev in
308                         --directory|-D)
309                                 comps=$(compgen -d -- "$cur")
310                                 compopt -o filenames
311                         ;;
312                         --output|-o)
313                                 comps='short short-monotonic verbose export json cat'
314                         ;;
315                         --field|-F)
316                                 comps=${__journal_fields[*]}
317                         ;;
318                         --unit|-u)
319                                 comps=$(journalctl -F '_SYSTEMD_UNIT')
320                         ;;
321                         *)
322                                 return 0
323                         ;;
324                 esac
325                 COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
326                 return 0
327         fi
328
329         if [[ $cur = -* ]]; then
330                 COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
331                 return 0
332         elif [[ $cur = *=* ]]; then
333                 mapfile -t field_vals < <(journalctl -F "${prev%=}" 2>/dev/null)
334                 COMPREPLY=( $(compgen -W '${field_vals[*]}' -- "${cur#=}") )
335         elif [[ $prev = '=' ]]; then
336                 mapfile -t field_vals < <(journalctl -F "${COMP_WORDS[COMP_CWORD-2]}" 2>/dev/null)
337                 COMPREPLY=( $(compgen -W '${field_vals[*]}' -- "$cur") )
338         else
339                 compopt -o nospace
340                 COMPREPLY=( $(compgen -W '${__journal_fields[*]}' -S= -- "$cur") )
341         fi
342 }
343 complete -F _journalctl journalctl
344
345 _coredumpctl() {
346         local i verb comps
347         local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
348         local OPTS='-h --help --version --no-pager --no-legend -o --output -F --field'
349
350         local -A VERBS=(
351             [LIST]='list'
352             [DUMP]='dump'
353         )
354
355         if __contains_word "$prev" '--output -o'; then
356                 comps=$( compgen -A file -- "$cur" )
357                 compopt -o filenames
358         elif __contains_word "$prev" '--FIELD -F'; then
359                 comps=$( compgen -W '${__journal_fields[*]}' -- "$cur" )
360         elif [[ $cur = -* ]]; then
361                 comps=${OPTS}
362         elif __contains_word "$prev" ${VERBS[*]} &&
363            ! __contains_word ${COMP_WORDS[COMP_CWORD-2]} '--output -o -F --field'; then
364                 compopt -o nospace
365                 COMPREPLY=( $(compgen -W '${__journal_fields[*]}' -S= -- "$cur") )
366                return 0
367         elif [[ $cur = *=* ]]; then
368                 mapfile -t field_vals < <(systemd-coredumpctl -F "${prev%=}" 2>/dev/null)
369                 COMPREPLY=( $(compgen -W '${field_vals[*]}' -- "${cur#=}") )
370                 return 0
371         else
372                 for ((i=0; i <= COMP_CWORD; i++)); do
373                         if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]}; then
374                                 verb=${COMP_WORDS[i]}
375                                 break
376                         fi
377                 done
378
379                 if [[ -z $verb ]]; then
380                         comps=${VERBS[*]}
381                 elif __contains_word "$verb" ${VERBS[LIST]} ${VERBS[DUMP]}; then
382                         comps=''
383                 fi
384         fi
385
386         COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
387         return 0
388 }
389 complete -F _coredumpctl systemd-coredumpctl
390
391 _timedatectl() {
392         local i verb comps
393         local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
394         local OPTS='-h --help --version --adjust-system-clock --no-pager
395                     --no-ask-password -H --host'
396
397         if __contains_word "$prev" $OPTS; then
398                 case $prev in
399                         --host|-H)
400                                 comps=''
401                         ;;
402                 esac
403                 COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
404                 return 0
405         fi
406
407         if [[ $cur = -* ]]; then
408                 COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
409                 return 0
410         fi
411
412         local -A VERBS=(
413                   [BOOLEAN]='set-local-rtc set-ntp'
414                [STANDALONE]='status set-time list-timezones'
415                 [TIMEZONES]='set-timezone'
416                      [TIME]='set-time'
417         )
418
419         for ((i=0; i <= COMP_CWORD; i++)); do
420                 if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]}; then
421                         verb=${COMP_WORDS[i]}
422                         break
423                 fi
424         done
425
426         if [[ -z $verb ]]; then
427                 comps=${VERBS[*]}
428         elif __contains_word "$verb" ${VERBS[BOOLEAN]}; then
429                 comps='true false'
430         elif __contains_word "$verb" ${VERBS[TIMEZONES]}; then
431                 comps=$(command timedatectl list-timezones)
432         elif __contains_word "$verb" ${VERBS[STANDALONE]} ${VERBS[TIME]}; then
433                 comps=''
434         fi
435
436         COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
437         return 0
438 }
439 complete -F _timedatectl timedatectl
440
441 _localectl() {
442         local i verb comps
443         local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
444         local OPTS='-h --help --version --no-convert --no-pager --no-ask-password
445                     -H --host'
446
447         if __contains_word "$prev" $OPTS; then
448                 case $prev in
449                         --host|-H)
450                                 comps=''
451                         ;;
452                 esac
453                 COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
454                 return 0
455         fi
456
457         if [[ $cur = -* ]]; then
458                 COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
459                 return 0
460         fi
461
462         local -A VERBS=(
463                [STANDALONE]='status list-locales list-keymaps'
464                   [LOCALES]='set-locale'
465                   [KEYMAPS]='set-keymap'
466                       [X11]='set-x11-keymap'
467         )
468
469         for ((i=0; i <= COMP_CWORD; i++)); do
470                 if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]}; then
471                         verb=${COMP_WORDS[i]}
472                         break
473                 fi
474         done
475
476         if [[ -z $verb ]]; then
477                 comps=${VERBS[*]}
478         elif __contains_word "$verb" ${VERBS[LOCALES]}; then
479                 comps=$(command localectl list-locales)
480         elif __contains_word "$verb" ${VERBS[KEYMAPS]}; then
481                 comps=$(command localectl list-keymaps)
482         elif __contains_word "$verb" ${VERBS[STANDALONE]} ${VERBS[X11]}; then
483                 comps=''
484         fi
485
486         COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
487         return 0
488 }
489 complete -F _localectl localectl
490
491 _hostnamectl() {
492         local i verb comps
493         local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
494         local OPTS='-h --help --version --transient --static --pretty
495                     --no-ask-password -H --host'
496
497         if [[ $cur = -* ]]; then
498                 COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
499                 return 0
500         fi
501
502         local -A VERBS=(
503                 [STANDALONE]='status'
504                      [ICONS]='set-icon-name'
505                       [NAME]='set-hostname'
506         )
507
508         for ((i=0; i <= COMP_CWORD; i++)); do
509                 if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]}; then
510                         verb=${COMP_WORDS[i]}
511                         break
512                 fi
513         done
514
515         if [[ -z $verb ]]; then
516                 comps=${VERBS[*]}
517         elif __contains_word "$verb" ${VERBS[STANDALONE]} ${VERBS[ICONS]} ${VERBS[NAME]}; then
518                 comps=''
519         fi
520
521         COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
522         return 0
523 }
524 complete -F _hostnamectl hostnamectl
525
526 __get_all_sysdevs() {
527         local -a devs=(/sys/bus/*/devices/*/ /sys/class/*/*/)
528         printf '%s\n' "${devs[@]%/}"
529 }
530
531 _udevadm() {
532         local i verb comps
533         local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
534         local OPTS='-h --help --version --debug'
535
536         local -A VERBS=(
537                 [INFO]='info'
538                 [TRIGGER]='trigger'
539                 [SETTLE]='settle'
540                 [CONTROL]='control'
541                 [MONITOR]='monitor'
542                 [HWDB]='hwdb'
543                 [TESTBUILTIN]='test-builtin'
544                 [TEST]='test'
545         )
546
547         for ((i=0; $i <= $COMP_CWORD; i++)); do
548                 if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]} &&
549                  ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
550                         verb=${COMP_WORDS[i]}
551                         break
552                 fi
553         done
554
555         if [[ -z $verb  && $cur = -* ]]; then
556                 COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
557                 return 0
558         fi
559
560         if [[ -z $verb ]]; then
561                 comps=${VERBS[*]}
562
563         elif __contains_word "$verb" ${VERBS[INFO]}; then
564                 if [[ $cur = -* ]]; then
565                         comps='--help --query= --path= --name= --root --attribute-walk --export-db --cleanup-db'
566                 else
567                         comps=$( __get_all_sysdevs )
568                 fi
569
570         elif __contains_word "$verb" ${VERBS[TRIGGER]}; then
571                 comps='--help --verbose --dry-run --type= --action= --subsystem-match=
572                        --subsystem-nomatch= --attr-match= --attr-nomatch= --property-match=
573                        --tag-match= --sysname-match= --parent-match='
574
575         elif __contains_word "$verb" ${VERBS[SETTLE]}; then
576                 comps='--help --timeout= --seq-start= --seq-end= --exit-if-exists= --quiet'
577
578         elif __contains_word "$verb" ${VERBS[CONTROL]}; then
579                 comps='--help --exit --log-priority= --stop-exec-queue --start-exec-queue
580                        --reload --property= --children-max= --timeout='
581
582         elif __contains_word "$verb" ${VERBS[MONITOR]}; then
583                 comps='--help --kernel --udev --property --subsystem-match= --tag-match='
584
585         elif __contains_word "$verb" ${VERBS[HWDB]}; then
586                 comps='--help --update --test='
587
588         elif __contains_word "$verb" ${VERBS[TEST]}; then
589                 if [[ $cur = -* ]]; then
590                         comps='--help --action='
591                 else
592                         comps=$( __get_all_sysdevs )
593                 fi
594
595         elif __contains_word "$verb" ${VERBS[TESTBUILTIN]}; then
596                       comps='blkid btrfs firmware hwdb input_id kmod path_id usb_id uaccess'
597         fi
598
599         COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
600         return 0
601 }
602 complete -F _udevadm udevadm