�ɲɾ�����ӯ�����һ��ˣ��������С���˴��ͣ�������P���ҹ��ñ˽��ά�Բ��������˸߸ԣ�������ơ��ҹ��ñ�����ά�Բ���ˡ���˳^�ӣ������ӡ� ���ͯj�ӣ��ƺ���ӣ� ? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!completions/mkfs.cramfs000064400000001465152525375750011263 0ustar00_mkfs.cramfs_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-b') COMPREPLY=( $(compgen -W "blksize" -- $cur) ) return 0 ;; '-e') COMPREPLY=( $(compgen -W "edition" -- $cur) ) return 0 ;; '-N') COMPREPLY=( $(compgen -W "big little host" -- $cur) ) return 0 ;; '-i') COMPREPLY=( $(compgen -f -- $cur) ) return 0 ;; '-n') COMPREPLY=( $(compgen -W "name" -- $cur) ) return 0 ;; '-h'|'-V') return 0 ;; esac case $cur in -*) OPTS="-h -v -E -b -e -N -i -n -p -s -z" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _mkfs.cramfs_module mkfs.cramfs completions/lslocks000064400000002055152525375750010517 0ustar00_lslocks_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-p'|'--pid') local PIDS # /proc/locks can have 8 to 9 fields, see commit # 55c0d16bab8cc84b72bf11cb2fdd8aa6205ac608 PIDS="$(awk '{print $(NF-3)}' /proc/locks)" COMPREPLY=( $(compgen -W "$PIDS" -- $cur) ) return 0 ;; '-o'|'--output') local prefix realcur OUTPUT_ALL OUTPUT realcur="${cur##*,}" prefix="${cur%$realcur}" OUTPUT_ALL="COMMAND PID TYPE SIZE MODE M START END PATH BLOCKER" for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac OPTS=" --json --noinaccessible --noheadings --output --pid --raw --notruncate --help --version " COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 } complete -F _lslocks_module lslocks completions/resizepart000064400000001070152525375750011231 0ustar00_resizepart_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $COMP_CWORD in 1) OPTS="--help --version $(lsblk -pnro name)" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) ;; 2) prev="${COMP_WORDS[COMP_CWORD-1]}" COMPREPLY=( $(compgen -W "$(cat /sys/block/${prev##*/}/*/partition 2>/dev/null)" -- $cur) ) ;; 3) COMPREPLY="length" ;; esac return 0 } complete -F _resizepart_module resizepart completions/lsmem000064400000002036152525375750010161 0ustar00_lsmem_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-o'|'--output') local prefix realcur OUTPUT_ALL OUTPUT realcur="${cur##*,}" prefix="${cur%$realcur}" OUTPUT_ALL='RANGE SIZE STATE REMOVABLE BLOCK NODE ZONES' for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- "$realcur") ) return 0 ;; '-s'|'--sysroot') local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -o dirnames -- ${cur:-"/"}) ) return 0 ;; '--summary') COMPREPLY=( $(compgen -W "never always only" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac OPTS=" --json --pairs --all --bytes --noheadings --output --raw --sysroot --summary --help --version " COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 } complete -F _lsmem_module lsmem completions/lslogins000064400000003250152525375750010675 0ustar00_lslogins_module() { local cur prev OPTS LSLOGINS_COLS_ALL COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" LSLOGINS_COLS_ALL=" USER UID GECOS HOMEDIR SHELL NOLOGIN PWD-LOCK PWD-EMPTY PWD-DENY GROUP GID SUPP-GROUPS SUPP-GIDS LAST-LOGIN LAST-TTY LAST-HOSTNAME FAILED-LOGIN FAILED-TTY HUSHED PWD-WARN PWD-CHANGE PWD-MIN PWD-MAX PWD-EXPIR CONTEXT PROC " case $prev in '-g'|'--groups') COMPREPLY=( $(compgen -W "$(getent group | awk -F: '{print $1}')" -- $cur) ) return 0 ;; '-l'|'--logins') COMPREPLY=( $(compgen -W "$(getent passwd | awk -F: '{print $1}')" -- $cur) ) return 0 ;; '--time-format') COMPREPLY=( $(compgen -W "short full iso" -- $cur) ) return 0 ;; '--wtmp-file'|'--btmp-file') local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 ;; '-o'|'--output') local prefix realcur LSLOGINS_COLS realcur="${cur##*,}" prefix="${cur%$realcur}" for WORD in $LSLOGINS_COLS_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then LSLOGINS_COLS="$WORD $LSLOGINS_COLS" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$LSLOGINS_COLS" -S ',' -- $realcur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac COMPREPLY=( $(compgen -W " --acc-expiration --colon-separate --export --failed --supp-groups --groups --last --logins --newline --noheadings --notruncate --output --pwd --raw --system-accs --time-format --user-accs --context --print0 --wtmp-file --btmp-file --help --version " -- $cur) ) return 0 } complete -F _lslogins_module lslogins completions/swaplabel000064400000001173152525375750011017 0ustar00_swaplabel_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-L'|'--label') COMPREPLY=( $(compgen -W "label" -- $cur) ) return 0 ;; '-U'|'--uuid') COMPREPLY=( $(compgen -W '$(uuidgen)' -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--label --uuid --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _swaplabel_module swaplabel completions/fdformat000064400000001066152525375750010650 0ustar00_fdformat_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-f'|'--from'|'-t'|'--to'|'-r'|'--repair') COMPREPLY=( $(compgen -W "track_num" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac DEVS=$(for I in echo /dev/fd*; do if [ -e $I ]; then echo $I; fi; done) OPTS=" --from --to --repair --no-verify --help --version $DEVS " COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 } complete -F _fdformat_module fdformat completions/pip3000064400000000436152525375750007721 0ustar00 # pip bash completion start _pip3_completion() { COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \ COMP_CWORD=$COMP_CWORD \ PIP_AUTO_COMPLETE=1 $1 ) ) } complete -o default -F _pip3_completion pip3 pip-3 pip3.6 pip-3.6 # pip bash completion end completions/isosize000064400000001021152525375750010522 0ustar00_isosize_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-d'|'--divisor') COMPREPLY=( $(compgen -W "number" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) COMPREPLY=( $(compgen -W "--divisor --sectors --help --version" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _isosize_module isosize completions/zramctl000064400000002371152525375750010522 0ustar00_zramctl_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-a'|'--algorithm') COMPREPLY=( $(compgen -W "lzo lz4 lz4hc deflate 842" -- $cur) ) return 0 ;; '-o'|'--output') local prefix realcur OUTPUT_ALL OUTPUT realcur="${cur##*,}" prefix="${cur%$realcur}" OUTPUT_ALL="NAME DISKSIZE DATA COMPR ALGORITHM STREAMS ZERO-PAGES TOTAL MEM-LIMIT MEM-USED MIGRATED MOUNTPOINT" for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) ) return 0 ;; '-s'|'--size') COMPREPLY=( $(compgen -W "size" -- $cur) ) return 0 ;; '-t'|'--streams') COMPREPLY=( $(compgen -W "number" -- $cur) ) return 0 ;; esac case $cur in -*) OPTS=" --algorithm --bytes --find --noheadings --output --raw --reset --size --streams --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- ${cur:-"/dev/zram"}) ) return 0 } complete -F _zramctl_module zramctl completions/rename000064400000001217152525375750010313 0ustar00_rename_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--verbose --symlink --help --version --no-act --no-override" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac case $COMP_CWORD in 1) COMPREPLY=( $(compgen -W "expression" -- $cur) ) ;; 2) COMPREPLY=( $(compgen -W "replacement" -- $cur) ) ;; *) local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) ;; esac return 0 } complete -F _rename_module rename completions/prlimit000064400000002461152525375750010526 0ustar00_prlimit_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-p'|'--pid') PIDS=$(cd /proc && echo [0-9]*) COMPREPLY=( $(compgen -W "$PIDS" -- $cur) ) return 0 ;; '-o'|'--output') local prefix realcur OUTPUT_ALL OUTPUT realcur="${cur##*,}" prefix="${cur%$realcur}" OUTPUT_ALL="DESCRIPTION RESOURCE SOFT HARD UNITS" for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in '=') cur=${cur#=} # FIXME: is there anything what could be printed # as limit value(s) ;; -*) OPTS="--pid --output --noheadings --raw --verbose --help --version --core= --data= --nice= --fsize= --sigpending= --memlock= --rss= --nofile= --msgqueue= --rtprio= --stack= --cpu= --nproc= --as= --locks= --rttime=" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac compopt -o bashdefault COMPREPLY=( $(compgen -c -- $cur) ) return 0 } complete -F _prlimit_module prlimit completions/delpart000064400000001016152525375750010474 0ustar00_delpart_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $COMP_CWORD in 1) OPTS="--help --version $(lsblk -pnro name)" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) ;; 2) prev="${COMP_WORDS[COMP_CWORD-1]}" COMPREPLY=( $(compgen -W "$(cat /sys/block/${prev##*/}/*/partition 2>/dev/null)" -- $cur) ) ;; esac return 0 } complete -F _delpart_module delpart completions/ionice000064400000002211152525375750010305 0ustar00_ionice_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-c'|'--class') COMPREPLY=( $(compgen -W "{0..3} none realtime best-effort idle" -- $cur) ) return 0 ;; '-n'|'--classdata') COMPREPLY=( $(compgen -W "{0..7}" -- $cur) ) return 0 ;; '-P'|'--pgid') local PGID PGID="$(awk '{print $5}' /proc/*/stat 2>/dev/null | sort -u)" COMPREPLY=( $(compgen -W "$PGID" -- $cur) ) return 0 ;; '-p'|'--pid') local PIDS PIDS=$(for I in /proc/[0-9]*; do echo ${I##"/proc/"}; done) COMPREPLY=( $(compgen -W "$PIDS" -- $cur) ) return 0 ;; '-u'|'--uid') local UIDS UIDS="$(stat --format='%u' /proc/[0-9]* | sort -u)" COMPREPLY=( $(compgen -W "$UIDS" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--class --classdata --pid --pgid --ignore --uid --version --help" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _ionice_module ionice completions/su000064400000001540152525375750007472 0ustar00_su_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-'|'-u'|'--user') COMPREPLY=( $(compgen -u -- $cur) ) return 0 ;; '-g'|'--group'|'-G'|'--supp-group') COMPREPLY=( $(compgen -g -- $cur) ) return 0 ;; '-s'|'--shell') COMPREPLY=( $(compgen -W "$(chsh -l)" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS=" --user --preserve-environment --group --supp-group --login --command --session-command --fast --shell --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _su_module su complete -F _su_module runuser completions/getopt000064400000001457152525375750010354 0ustar00_getopt_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-l'|'--longoptions') COMPREPLY=( $(compgen -W "longopts" -- $cur) ) return 0 ;; '-n'|'--name') COMPREPLY=( $(compgen -W "name" -- $cur) ) return 0 ;; '-o'|'--options') COMPREPLY=( $(compgen -W "optstring" -- $cur) ) return 0 ;; '-s'|'--shell') COMPREPLY=( $(compgen -W "sh bash csh tcsh" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--alternative --help --longoptions --name --options --quiet --quiet-output --shell --test --unquoted --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac return 0 } complete -F _getopt_module getopt completions/uuidgen000064400000001221152525375750010477 0ustar00_uuidgen_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-n'|'--namespace') COMPREPLY=( $(compgen -W "@dns @url @oid @x500 @x.500" -- "$cur") ) return 0 ;; '-N'|'--name') COMPREPLY=( $(compgen -W "name" -- "$cur") ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS=" --random --time --namespace --name --md5 --sha1 --hex --help --version " COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac return 0 } complete -F _uuidgen_module uuidgen completions/write000064400000000657152525375750010205 0ustar00_write_module() { local cur prev COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $COMP_CWORD in 1) COMPREPLY=( $(compgen -W '$(users)' -- $cur) ) return 0 ;; 2) COMPREPLY=( $(compgen -W "$(w -h $prev | awk '{print $2}')" -- $cur) ) return 0 ;; esac return 0 } complete -F _write_module write completions/ldattach000064400000002700152525375750010626 0ustar00_ldattach_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-s'|'--speed') COMPREPLY=( $(compgen -W "speed" -- $cur) ) return 0 ;; '-c'|'--intro-command') COMPREPLY=( $(compgen -W "string" -- $cur) ) return 0 ;; '-p'|'--pause') COMPREPLY=( $(compgen -W "seconds" -- $cur) ) return 0 ;; '-i'|'--iflag') local IFLAGS IFLAGS="BRKINT ICRNL IGNBRK IGNCR IGNPAR IMAXBEL INLCR INPCK ISTRIP IUCLC IUTF8 IXANY IXOFF IXON PARMRK -BRKINT -ICRNL -IGNBRK -IGNCR -IGNPAR -IMAXBEL -INLCR -INPCK -ISTRIP -IUCLC -IUTF8 -IXANY -IXOFF -IXON -PARMRK" COMPREPLY=( $(compgen -W "$IFLAGS" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--debug --speed --intro-command --pause --sevenbits --eightbits --noparity --evenparity --oddparity --onestopbit --twostopbits --iflag --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; /*) local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 ;; esac local LDISC_DEVICE LDISC_DEVICE="6PACK AX25 GIGASET GIGASET_M101 HCI HDLC IRDA M101 MOUSE PPP PPS R3964 SLIP STRIP SYNCPPP SYNC_PPP TTY X25 /dev/" COMPREPLY=( $(compgen -W "$LDISC_DEVICE" -- $cur) ) return 0 } complete -F _ldattach_module ldattach completions/chrt000064400000001630152525375750010003 0ustar00_chrt_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-h'|'--help'|'-V'|'--version') return 0 ;; '-T'|'--sched-runtime'|'-P'|'--sched-period'|'-D'|'--sched-deadline') COMPREPLY=( $(compgen -W "nanoseconds" -- $cur) ) return 0 ;; esac case $cur in -*) OPTS=" --all-tasks --batch --deadline --fifo --help --idle --max --other --pid --reset-on-fork --rr --sched-deadline --sched-period --sched-runtime --verbose --version " COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local i for i in ${COMP_WORDS[*]}; do case $i in '-p'|'--pid') COMPREPLY=( $(compgen -W "$(cd /proc && echo [0-9]*)" -- $cur) ) return 0 ;; esac done COMPREPLY=( $(compgen -c -- $cur) ) return 0 } complete -F _chrt_module chrt completions/devlink000064400000065414152525375750010511 0ustar00# bash completion for devlink(8) -*- shell-script -*- # Get all the optional commands for devlink _devlink_get_optional_commands() { local object=$1; shift local filter_options="" local options="$(devlink $object help 2>&1 \ | command sed -n -e "s/^.*devlink $object //p" \ | cut -d " " -f 1)" # Remove duplicate options from "devlink $OBJECT help" command local opt for opt in $options; do if [[ $filter_options =~ $opt ]]; then continue else filter_options="$filter_options $opt" fi done echo $filter_options } # Complete based on given word, for when an argument or an option name has # but a few possible arguments. _devlink_direct_complete() { local dev port region value case $1 in dev) value=$(devlink dev show 2>/dev/null) ;; selftests_id) dev=${words[4]} value=$(devlink -j dev selftests show 2>/dev/null \ | jq ".selftests[\"$dev\"][]") ;; param_name) dev=${words[4]} value=$(devlink -j dev param show 2>/dev/null \ | jq ".param[\"$dev\"][].name") ;; port) value=$(devlink -j port show 2>/dev/null \ | jq '.port as $ports | $ports | keys[] as $key | ($ports[$key].netdev // $key)') ;; lc) dev=${words[3]} value=$(devlink -j lc show 2>/dev/null \ | jq ".lc[\"$dev\"]" \ | jq '. as $lcs | $lcs | keys[] as $key |($lcs[$key].lc)' \ 2>/dev/null) ;; lc_type) dev=${words[3]} lc=${words[5]} value=$(devlink lc show $dev lc $lc -j 2>/dev/null \ | jq '.[][][]["supported_types"][]') ;; region) value=$(devlink -j region show 2>/dev/null \ | jq '.regions' | jq 'keys[]') ;; snapshot) region=${words[3]} value=$(devlink -j region show 2>/dev/null \ | jq ".regions[\"$region\"].snapshot[]") ;; trap) dev=${words[3]} value=$(devlink -j trap show 2>/dev/null \ | jq ".trap[\"$dev\"][].name") ;; trap_group) dev=${words[4]} value=$(devlink -j trap group show 2>/dev/null \ | jq ".trap_group[\"$dev\"][].name") ;; trap_policer) dev=${words[4]} value=$(devlink -j trap policer show 2>/dev/null \ | jq ".trap_policer[\"$dev\"][].policer") ;; health_dev) value=$(devlink -j health show 2>/dev/null | jq '.health' \ | jq 'keys[]') ;; reporter) dev=${words[cword - 2]} value=$(devlink -j health show 2>/dev/null \ | jq ".health[\"$dev\"][].reporter") ;; pool) dev=$pprev value=$(devlink -j sb pool show 2>/dev/null \ | jq ".pool[\"$dev\"][].pool") ;; port_pool) port=${words[5]} value=$(devlink -j sb port pool show 2>/dev/null \ | jq ".port_pool[\"$port\"][].pool") ;; tc) port=$pprev value=$(devlink -j sb tc bind show 2>/dev/null \ | jq ".tc_bind[\"$port\"][].tc") ;; esac COMPREPLY+=( $( compgen -W "$value" -- "$cur" ) ) # Remove colon containing prefix from COMPREPLY items in order to avoid # wordbreaks with colon. __ltrim_colon_completions "$cur" } # Completion for devlink dev eswitch set _devlink_dev_eswitch_set() { local -A settings=( [mode]=notseen [inline-mode]=notseen [encap-mode]=notseen ) if [[ $cword -eq 5 ]]; then COMPREPLY=( $( compgen -W "mode inline-mode encap-mode" -- "$cur" ) ) fi # Mark seen settings local word for word in "${words[@]:5:${#words[@]}-1}"; do if [[ -n $word ]]; then if [[ "${settings[$word]}" ]]; then settings[$word]=seen fi fi done case $prev in mode) COMPREPLY=( $( compgen -W "legacy switchdev" -- "$cur" ) ) return ;; inline-mode) COMPREPLY=( $( compgen -W "none link network transport" -- \ "$cur" ) ) return ;; encap-mode) COMPREPLY=( $( compgen -W "none basic" -- "$cur" ) ) return ;; esac local -a comp_words=() # Add settings not seen to completions local setting for setting in "${!settings[@]}"; do if [ "${settings[$setting]}" = notseen ]; then comp_words+=( "$setting" ) fi done COMPREPLY=( $( compgen -W "${comp_words[*]}" -- "$cur" ) ) } # Completion for devlink dev eswitch _devlink_dev_eswitch() { case "$cword" in 3) COMPREPLY=( $( compgen -W "show set" -- "$cur" ) ) return ;; 4) _devlink_direct_complete "dev" return ;; esac case "${words[3]}" in set) _devlink_dev_eswitch_set return ;; show) return ;; esac } # Completion for devlink dev param set _devlink_dev_param_set() { case $cword in 7) COMPREPLY=( $( compgen -W "value" -- "$cur" ) ) return ;; 8) # String argument return ;; 9) COMPREPLY=( $( compgen -W "cmode" -- "$cur" ) ) return ;; 10) COMPREPLY=( $( compgen -W "runtime driverinit permanent" -- \ "$cur" ) ) return ;; esac } # Completion for devlink dev param _devlink_dev_param() { case "$cword" in 3) COMPREPLY=( $( compgen -W "show set" -- "$cur" ) ) return ;; 4) _devlink_direct_complete "dev" return ;; 5) COMPREPLY=( $( compgen -W "name" -- "$cur" ) ) return ;; 6) _devlink_direct_complete "param_name" return ;; esac if [[ "${words[3]}" == "set" ]]; then _devlink_dev_param_set fi } # Completion for devlink dev reload _devlink_dev_reload() { case "$cword" in 4) COMPREPLY=( $( compgen -W "netns" -- "$cur" ) ) return ;; 5) local nslist=$( ip netns list 2>/dev/null ) COMPREPLY=( $( compgen -W "$nslist" -- "$cur" ) ) return ;; esac } # Completion for devlink dev flash _devlink_dev_flash() { case "$cword" in 4) COMPREPLY=( $( compgen -W "file" -- "$cur" ) ) return ;; 5) _filedir return ;; 6) COMPREPLY=( $( compgen -W "component" -- "$cur" ) ) return ;; esac } # Completion for devlink dev selftests _devlink_dev_selftests() { if [[ $cword -gt 5 ]]; then _devlink_direct_complete "selftests_id" return fi case "$cword" in 3) COMPREPLY=( $( compgen -W "show run" -- "$cur" ) ) return ;; 4) _devlink_direct_complete "dev" return ;; 5) COMPREPLY=( $( compgen -W "id" -- "$cur" ) ) return ;; esac } # Completion for devlink dev _devlink_dev() { case $command in show|reload|info|flash) if [[ $cword -le 3 ]]; then _devlink_direct_complete "dev" elif [[ $command == "reload" || $command == "flash" ]];then _devlink_dev_$command fi return ;; eswitch|param|selftests) _devlink_dev_$command return ;; esac } # Completion for devlink port set _devlink_port_set() { case "$cword" in 3) _devlink_direct_complete "port" return ;; 4) COMPREPLY=( $( compgen -W "type" -- "$cur" ) ) return ;; 5) COMPREPLY=( $( compgen -W "eth ib auto" -- "$cur" ) ) return ;; esac } # Completion for devlink port split _devlink_port_split() { case "$cword" in 3) _devlink_direct_complete "port" return ;; 4) COMPREPLY=( $( compgen -W "count" -- "$cur" ) ) return ;; 5) # Integer argument return ;; esac } # Completion for devlink port param set _devlink_port_param_set() { case $cword in 7) COMPREPLY=( $( compgen -W "value" -- "$cur" ) ) return ;; 8) # String argument return ;; 9) COMPREPLY=( $( compgen -W "cmode" -- "$cur" ) ) return ;; 10) COMPREPLY=( $( compgen -W "runtime driverinit permanent" -- \ "$cur" ) ) return ;; esac } # Completion for devlink port param _devlink_port_param() { case "$cword" in 3) COMPREPLY=( $( compgen -W "show set" -- "$cur" ) ) return ;; 4) _devlink_direct_complete "port" return ;; 5) COMPREPLY=( $( compgen -W "name" -- "$cur" ) ) return ;; 6) _devlink_direct_complete "param_name" return ;; esac if [[ "${words[3]}" == "set" ]]; then _devlink_port_param_set fi } # Completion for devlink port _devlink_port() { case $command in set) _devlink_port_set return ;; split) _devlink_port_split return ;; param) _devlink_port_param return ;; show|unsplit) if [[ $cword -eq 3 ]]; then _devlink_direct_complete "port" fi return ;; esac } # Completion for devlink lc set _devlink_lc_set() { case "$cword" in 3) _devlink_direct_complete "dev" return ;; 4) COMPREPLY=( $( compgen -W "lc" -- "$cur" ) ) ;; 5) _devlink_direct_complete "lc" ;; 6) COMPREPLY=( $( compgen -W "type notype" -- "$cur" ) ) return ;; 7) if [[ "$prev" == "type" ]]; then _devlink_direct_complete "lc_type" fi esac } # Completion for devlink lc show _devlink_lc_show() { case $cword in 3) _devlink_direct_complete "dev" ;; 4) COMPREPLY=( $( compgen -W "lc" -- "$cur" ) ) ;; 5) _devlink_direct_complete "lc" ;; esac } # Completion for devlink lc _devlink_lc() { case $command in set) _devlink_lc_set return ;; show) _devlink_lc_show return ;; esac } # Completion for devlink dpipe _devlink_dpipe() { local options="$(devlink dpipe help 2>&1 \ | command sed -e '/OBJECT-LIST := /!d' \ -e 's/.*{ //' -e 's/}.*//' -e 's/|//g' )" if [[ $cword -eq 2 ]]; then COMPREPLY+=( $( compgen -W "$options" -- "$cur" ) ) fi } # Completion for devlink monitor _devlink_monitor() { local options="$(devlink monitor help 2>&1 \ | command sed -e '/OBJECT-LIST := /!d' \ -e 's/.*{ //' -e 's/}.*//' -e 's/|//g' )" if [[ $cword -eq 2 ]]; then COMPREPLY+=( $( compgen -W "all $options" -- "$cur" ) ) fi } # Completion for the rest of devlink sb $command _devlink_sb_command_options() { local subcmd case $command in pool) subcmd=${words[3]} if [[ $cword -eq 5 ]]; then COMPREPLY=( $( compgen -W "pool" -- "$cur" ) ) fi if [[ $subcmd == "set" ]]; then case $cword in 7) COMPREPLY+=( $( compgen -W "size" -- "$cur" ) ) ;; 9) COMPREPLY+=( $( compgen -W "thtype" -- "$cur" ) ) ;; esac fi ;; port) subcmd=${words[4]} if [[ $cword -eq 6 ]]; then COMPREPLY+=( $( compgen -W "pool" -- "$cur" ) ) fi if [[ $subcmd == "set" ]]; then case $cword in 8) COMPREPLY+=( $( compgen -W "th" -- "$cur" ) ) ;; esac fi ;; tc) subcmd=${words[4]} case $cword in 6) COMPREPLY+=( $( compgen -W "tc" -- "$cur" ) ) ;; 8) COMPREPLY+=( $( compgen -W "type" -- "$cur" ) ) ;; esac if [[ $subcmd == "set" ]]; then case $cword in 10) COMPREPLY+=( $( compgen -W "pool" -- "$cur" ) ) ;; 12) COMPREPLY+=( $( compgen -W "th" -- "$cur" ) ) ;; esac fi ;; esac } # Completion for devlink sb _devlink_sb() { case $prev in bind) COMPREPLY=( $( compgen -W "set show" -- "$cur" ) ) ;; occupancy) COMPREPLY=( $( compgen -W "show snapshot clearmax" -- "$cur" ) ) ;; pool) if [[ $cword -eq 3 || $cword -eq 4 ]]; then COMPREPLY=( $( compgen -W "set show" -- "$cur" ) ) elif [[ $command == "port" || $command == "tc" ]]; then _devlink_direct_complete "port_pool" else _devlink_direct_complete "pool" fi ;; port) if [[ $cword -eq 3 ]]; then COMPREPLY=( $( compgen -W "pool" -- "$cur" ) ) fi ;; show|set|snapshot|clearmax) case $command in show|pool|occupancy) _devlink_direct_complete "dev" if [[ $command == "occupancy" && $prev == "show" ]];then _devlink_direct_complete "port" fi ;; port|tc) _devlink_direct_complete "port" ;; esac ;; size) # Integer argument ;; thtype) COMPREPLY=( $( compgen -W "static dynamic" -- "$cur" ) ) ;; th) # Integer argument ;; tc) if [[ $cword -eq 3 ]]; then COMPREPLY=( $( compgen -W "bind" -- "$cur" ) ) else _devlink_direct_complete "tc" fi ;; type) COMPREPLY=( $( compgen -W "ingress egress" -- "$cur" ) ) ;; esac _devlink_sb_command_options return } # Completion for devlink resource set path argument _devlink_resource_path() { local path parents parent all_path local dev=${words[3]} local -a path local all_path=$( devlink resource show $dev \ | sed -E '# Of resource lines, keep only the name itself. s/name ([^ ]*) .*/\1/ # Drop headers. /:$/d # First layer is not aligned enough, align it. s/^/ / # Use slashes as unary code for resource depth. s, ,/,g # Separate tally count from resource name. s,/*,&\t,' \ | while read d name; do while ((${#path[@]} > ${#d})); do unset path[$((${#path[@]} - 1))] done path[$((${#d} - 1))]=$name echo ${path[@]} done \ | sed '# Convert paths to slash-separated s,^,/,;s, ,/,g;s,$,/,' ) COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -W "$all_path" -- "$cur" ) ) } # Completion for devlink resource set _devlink_resource_set() { case "$cword" in 3) _devlink_direct_complete "dev" return ;; 4) COMPREPLY=( $( compgen -W "path" -- "$cur" ) ) return ;; 5) _devlink_resource_path return ;; 6) COMPREPLY=( $( compgen -W "size" -- "$cur" ) ) return ;; 7) # Integer argument return ;; esac } # Completion for devlink resource _devlink_resource() { case $command in show) if [[ $cword -eq 3 ]]; then _devlink_direct_complete "dev" fi return ;; set) _devlink_resource_set return ;; esac } # Completion for devlink region read _devlink_region_read() { case "$cword" in 6) COMPREPLY=( $( compgen -W "address" -- "$cur" ) ) return ;; 7) # Address argument, for example: 0x10 return ;; 8) COMPREPLY=( $( compgen -W "length" -- "$cur" ) ) return ;; 9) # Integer argument return ;; esac } # Completion for devlink region _devlink_region() { if [[ $cword -eq 3 && $command != "help" ]]; then _devlink_direct_complete "region" fi case $command in show) return ;; del|dump|read) case "$cword" in 4) COMPREPLY=( $( compgen -W "snapshot" -- "$cur" ) ) ;; 5) _devlink_direct_complete "snapshot" ;; esac if [[ $command == "read" ]]; then _devlink_region_read fi return ;; esac } # Completion reporter for devlink health _devlink_health_reporter() { local i=$1; shift case $cword in $((3 + $i))) _devlink_direct_complete "health_dev" ;; $((4 + $i))) COMPREPLY=( $( compgen -W "reporter" -- "$cur" ) ) ;; $((5 + $i))) _devlink_direct_complete "reporter" ;; esac } # Completion for devlink health _devlink_health() { case $command in show|recover|diagnose|set|test) _devlink_health_reporter 0 if [[ $command == "set" ]]; then case $cword in 6) COMPREPLY=( $( compgen -W "grace_period auto_recover" \ -- "$cur" ) ) ;; 7) case $prev in grace_period) # Integer argument- msec ;; auto_recover) COMPREPLY=( $( compgen -W "true false" -- \ "$cur" ) ) ;; esac esac fi return ;; dump) if [[ $cword -eq 3 ]]; then COMPREPLY=( $( compgen -W "show clear" -- "$cur" ) ) fi _devlink_health_reporter 1 return ;; esac } # Completion for action in devlink trap set _devlink_trap_set_action() { local i=$1; shift case $cword in $((6 + $i))) COMPREPLY=( $( compgen -W "action" -- "$cur" ) ) ;; $((7 + $i))) COMPREPLY=( $( compgen -W "trap drop mirror" -- "$cur" ) ) ;; esac } # Completion for devlink trap group set _devlink_trap_group_set() { local -A settings=( [action]=notseen [policer]=notseen [nopolicer]=notseen ) if [[ $cword -eq 7 ]]; then COMPREPLY=( $( compgen -W "action policer nopolicer" -- "$cur" ) ) fi # Mark seen settings local word for word in "${words[@]:7:${#words[@]}-1}"; do if [[ -n $word ]]; then if [[ "${settings[$word]}" ]]; then settings[$word]=seen fi fi done case $prev in action) COMPREPLY=( $( compgen -W "trap drop mirror" -- "$cur" ) ) return ;; policer) _devlink_direct_complete "trap_policer" return ;; esac local -a comp_words=() # Add settings not seen to completions local setting for setting in "${!settings[@]}"; do if [ "${settings[$setting]}" = notseen ]; then comp_words+=( "$setting" ) fi done COMPREPLY=( $( compgen -W "${comp_words[*]}" -- "$cur" ) ) } # Completion for devlink trap group _devlink_trap_group() { case $cword in 3) COMPREPLY=( $( compgen -W "set show" -- "$cur" ) ) return ;; 4) _devlink_direct_complete "dev" return ;; 5) COMPREPLY=( $( compgen -W "group" -- "$cur" ) ) return ;; 6) _devlink_direct_complete "trap_group" return ;; esac if [[ ${words[3]} == "set" ]]; then _devlink_trap_group_set fi } # Completion for devlink trap policer set _devlink_trap_policer_set() { local -A settings=( [rate]=notseen [burst]=notseen ) if [[ $cword -eq 7 ]]; then COMPREPLY=( $( compgen -W "rate burst" -- "$cur" ) ) fi # Mark seen settings local word for word in "${words[@]:7:${#words[@]}-1}"; do if [[ -n $word ]]; then if [[ "${settings[$word]}" ]]; then settings[$word]=seen fi fi done case $prev in rate) # Integer argument return ;; burst) # Integer argument return ;; esac local -a comp_words=() # Add settings not seen to completions local setting for setting in "${!settings[@]}"; do if [ "${settings[$setting]}" = notseen ]; then comp_words+=( "$setting" ) fi done COMPREPLY=( $( compgen -W "${comp_words[*]}" -- "$cur" ) ) } # Completion for devlink trap policer _devlink_trap_policer() { case $cword in 3) COMPREPLY=( $( compgen -W "set show" -- "$cur" ) ) return ;; 4) _devlink_direct_complete "dev" return ;; 5) COMPREPLY=( $( compgen -W "policer" -- "$cur" ) ) return ;; 6) _devlink_direct_complete "trap_policer" return ;; esac if [[ ${words[3]} == "set" ]]; then _devlink_trap_policer_set fi } # Completion for devlink trap _devlink_trap() { case $command in show|set) case $cword in 3) _devlink_direct_complete "dev" ;; 4) COMPREPLY=( $( compgen -W "trap" -- "$cur" ) ) ;; 5) _devlink_direct_complete "trap" ;; esac if [[ $command == "set" ]]; then _devlink_trap_set_action 0 fi return ;; group) _devlink_trap_$command return ;; policer) _devlink_trap_$command return ;; esac } # Complete any devlink command _devlink() { local cur prev words cword local opt='--Version --no-nice-names --json --pretty --verbose \ --statistics --force --Netns --batch' local objects="$(devlink help 2>&1 | command sed -e '/OBJECT := /!d' \ -e 's/.*{//' -e 's/}.*//' -e \ 's/|//g' )" _init_completion || return # Gets the word-to-complete without considering the colon as word breaks _get_comp_words_by_ref -n : cur prev words cword if [[ $cword -eq 1 ]]; then case $cur in -*) COMPREPLY=( $( compgen -W "$opt" -- "$cur" ) ) return 0 ;; *) COMPREPLY=( $( compgen -W "$objects" -- "$cur" ) ) return 0 ;; esac fi # Deal with options if [[ $prev == -* ]]; then case $prev in -V|--Version) return 0 ;; -b|--batch) _filedir return 0 ;; --force) COMPREPLY=( $( compgen -W "--batch" -- "$cur" ) ) return 0 ;; -N|--Netns) local nslist=$( ip netns list 2>/dev/null ) COMPREPLY=( $( compgen -W "$nslist" -- "$cur" ) ) return 0 ;; -j|--json) COMPREPLY=( $( compgen -W "--pretty $objects" -- "$cur" ) ) return 0 ;; *) COMPREPLY=( $( compgen -W "$objects" -- "$cur" ) ) return 0 ;; esac fi # Remove all options so completions don't have to deal with them. local i for (( i=1; i < ${#words[@]}; )); do if [[ ${words[i]::1} == - ]]; then words=( "${words[@]:0:i}" "${words[@]:i+1}" ) [[ $i -le $cword ]] && cword=$(( cword - 1 )) else i=$(( ++i )) fi done local object=${words[1]} local command=${words[2]} local pprev=${words[cword - 2]} local prev=${words[cword - 1]} if [[ $objects =~ $object ]]; then if [[ $cword -eq 2 ]]; then COMPREPLY=( $( compgen -W "help" -- "$cur") ) if [[ $object != "monitor" && $object != "dpipe" ]]; then COMPREPLY+=( $( compgen -W \ "$(_devlink_get_optional_commands $object)" -- "$cur" ) ) fi fi "_devlink_$object" fi } && complete -F _devlink devlink # ex: ts=4 sw=4 et filetype=sh completions/lsns000064400000002217152525375750010024 0ustar00_lsns_module() { local cur prev OPTS LSNS_COLS_ALL COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" LSNS_COLS_ALL=" NS TYPE PATH NPROCS PID PPID COMMAND UID USER " case $prev in '-o'|'--output') local prefix realcur LSNS_COLS realcur="${cur##*,}" prefix="${cur%$realcur}" for WORD in $LSNS_COLS_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then LSNS_COLS="$WORD $LSNS_COLS" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$LSNS_COLS" -S ',' -- $realcur) ) return 0 ;; '-p'|'--task') COMPREPLY=( $(compgen -W "$(cd /proc && echo [0-9]*)" -- $cur) ) return 0 ;; '-t'|'--type') COMPREPLY=( $(compgen -W "mnt net ipc user pid uts cgroup" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) COMPREPLY=( $(compgen -W " --json --list --noheadings --output --task --raw --notruncate --type --help --version " -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -W "mnt net pid uts ipc user" -- $cur ) ) return 0 } complete -F _lsns_module lsns completions/nmcli000064400000007401152525375750010147 0ustar00# nmcli(1) completion _nmcli_array_delete_at() { eval "local ARRAY=(\"\${$1[@]}\")" local i local tmp=() local lower=$2 local upper=${3:-$lower} # for some reason the following fails. So this clumsy workaround... # A=(a "") # echo " >> ${#A[@]}" # >> 2 # A=("${A[@]:1}") # echo " >> ${#A[@]}" # >> 0 # ... seriously??? for i in "${!ARRAY[@]}"; do if [[ "$i" -lt "$2" || "$i" -gt "${3-$2}" ]]; then tmp=("${tmp[@]}" "${ARRAY[$i]}") fi done eval "$1=(\"\${tmp[@]}\")" } _nmcli() { local cur prev words cword i output _init_completion || return # we don't care about any arguments after the current cursor position # because we only parse from left to right. So, if there are some arguments # right of the cursor, just ignore them. Also don't care about ${words[0]}. _nmcli_array_delete_at words $((cword+1)) ${#words[@]} _nmcli_array_delete_at words 0 # _init_completion returns the words with all the quotes and escaping # characters. We don't care about them, drop them at first. for i in ${!words[@]}; do words[i]="$(printf '%s' "${words[i]}" | xargs printf '%s\n' 2>/dev/null || true)" done # In case the cursor is not at the end of the line, # $cur consists of spaces that we want do remove. # For example: `nmcli connection modify id lo` if [[ "$cur" =~ ^[[:space:]]+ ]]; then cur='' fi output="$(nmcli --complete-args "${words[@]}" 2>/dev/null)" # Bail out early if we're completing a file name if [ $? = 65 ]; then compopt -o default COMPREPLY=() return 0 fi local IFS=$'\n' COMPREPLY=( $( compgen -W '$output' -- $cur ) ) # Now escape special characters (spaces, single and double quotes), # so that the argument is really regarded a single argument by bash. # See http://stackoverflow.com/questions/1146098/properly-handling-spaces-and-quotes-in-bash-completion local escaped_single_quote="'\''" local i=0 local entry for entry in ${COMPREPLY[*]} do if [[ "${cur:0:1}" == "'" ]]; then # started with single quote, escaping only other single quotes # [']bla'bla"bla\bla bla --> [']bla'\''bla"bla\bla bla COMPREPLY[$i]="${entry//\'/${escaped_single_quote}}" elif [[ "${cur:0:1}" == '"' ]]; then # started with double quote, escaping all double quotes and all backslashes # ["]bla'bla"bla\bla bla --> ["]bla'bla\"bla\\bla bla entry="${entry//\\/\\\\}" entry="${entry//\"/\\\"}" entry="${entry//!/\"\\!\"}" COMPREPLY[$i]="$entry" else # no quotes in front, escaping _everything_ # [ ]bla'bla"bla\bla bla --> [ ]bla\'bla\"bla\\bla\ bla entry="${entry//\\/\\\\}" entry="${entry//\'/\\\'}" entry="${entry//\"/\\\"}" entry="${entry// /\\ }" entry="${entry//\(/\\(}" entry="${entry//)/\\)}" entry="${entry//!/\\!}" entry="${entry//&/\\&}" COMPREPLY[$i]="$entry" fi (( i++ )) done # Work-around bash_completion issue where bash interprets a colon # as a separator. # Colon is escaped here. Change "\\:" back to ":". # See also: # http://stackoverflow.com/questions/28479216/how-to-give-correct-suggestions-to-tab-complete-when-my-words-contains-colons # http://stackoverflow.com/questions/2805412/bash-completion-for-maven-escapes-colon/12495727 i=0 for entry in ${COMPREPLY[*]} do entry="${entry//\\\\:/:}" COMPREPLY[$i]=${entry} (( i++ )) done } && complete -F _nmcli nmcli # ex: ts=4 sw=4 et filetype=sh completions/whereis000064400000001027152525375750010511 0ustar00_whereis_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-B'|'-M'|'-S') local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -o dirnames -- ${cur:-"/"}) ) return 0 ;; '-h'|'-V') return 0 ;; esac case $cur in -*) OPTS="-b -B -m -M -s -S -f -u -l" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -W "file" -- $cur) ) return 0 } complete -F _whereis_module whereis completions/ipcs000064400000001002152525375750007772 0ustar00_ipcs_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-i'|'--id') COMPREPLY=( $(compgen -W "id" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac OPTS="--id --help --version --shmems --queues --semaphores --all --time --pid --creator --limits --summary --human --bytes" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 } complete -F _ipcs_module ipcs completions/coredumpctl000064400000007203152525375750011366 0ustar00# coredumpctl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # Copyright © 2010 Ran Benita # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . __contains_word () { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done } __journal_fields=(MESSAGE{,_ID} PRIORITY CODE_{FILE,LINE,FUNC} ERRNO SYSLOG_{FACILITY,IDENTIFIER,PID} COREDUMP_EXE _{P,U,G}ID _COMM _EXE _CMDLINE _AUDIT_{SESSION,LOGINUID} _SYSTEMD_{CGROUP,SESSION,UNIT,OWNER_UID} _SELINUX_CONTEXT _SOURCE_REALTIME_TIMESTAMP _{BOOT,MACHINE}_ID _HOSTNAME _TRANSPORT _KERNEL_{DEVICE,SUBSYSTEM} _UDEV_{SYSNAME,DEVNODE,DEVLINK} __CURSOR __{REALTIME,MONOTONIC}_TIMESTAMP) _coredumpctl() { local i verb comps local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local OPTS='-h --help --version --no-pager --no-legend -o --output -F --field -1 -r --reverse -S --since -U --until -D --directory -q --quiet' local -A VERBS=( [LIST]='list info' [DUMP]='dump gdb' ) if __contains_word "$prev" '--output -o'; then comps=$( compgen -A file -- "$cur" ) compopt -o filenames elif __contains_word "$prev" '-D --directory'; then comps=$( compgen -A directory -- "$cur" ) compopt -o filenames elif __contains_word "$prev" '--field -F'; then comps=$( compgen -W '${__journal_fields[*]}' -- "$cur" ) elif [[ $cur = -* ]]; then comps=${OPTS} elif __contains_word "$prev" ${VERBS[*]} && ! __contains_word ${COMP_WORDS[COMP_CWORD-2]} '--output -o -D --directory -F --field'; then compopt -o nospace COMPREPLY=( $(compgen -W '${__journal_fields[*]}' -S= -- "$cur") ) return 0 elif [[ $cur = *=* ]]; then mapfile -t field_vals < <(coredumpctl -F "${prev%=}" 2>/dev/null) COMPREPLY=( $(compgen -W '${field_vals[*]}' -- "${cur#=}") ) return 0 elif [[ $prev = '=' ]]; then mapfile -t field_vals < <(coredumpctl -F "${COMP_WORDS[COMP_CWORD-2]}" 2>/dev/null) comps=${field_vals[*]} else for ((i=0; i <= COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]}; then verb=${COMP_WORDS[i]} break fi done if [[ -z $verb ]]; then comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[LIST]} ${VERBS[DUMP]}; then comps='' fi fi COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 } complete -F _coredumpctl coredumpctl completions/chcpu000064400000002746152525375750010156 0ustar00_chcpu_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-e'|'--enable') local prefix realcur CPULIST_ALL CPULIST realcur="${cur##*,}" prefix="${cur%$realcur}" CPULIST_ALL=$(sed 's/^/{/; s/-/../g; s/,/} {/g; s/$/}/' /sys/devices/system/cpu/offline) for WORD in $(eval echo $CPULIST_ALL); do if ! [[ $prefix == *"$WORD"* ]]; then CPULIST="$WORD $CPULIST" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$CPULIST" -S ',' -- $realcur) ) return 0 ;; '-d'|'--disable') local prefix realcur CPULIST_ALL CPULIST realcur="${cur##*,}" prefix="${cur%$realcur}" CPULIST_ALL=$(sed 's/^/{/; s/-/../g; s/,/} {/g; s/$/}/' /sys/devices/system/cpu/online) for WORD in $(eval echo $CPULIST_ALL); do if ! [[ $prefix == *"$WORD"* ]]; then CPULIST="$WORD $CPULIST" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$CPULIST" -S ',' -- $realcur) ) return 0 ;; '-c'|'--configure'|'-g'|'--deconfigure') COMPREPLY=( $(compgen -W "cpu-list" -- $cur) ) return 0 ;; '-p'|'--dispatch') COMPREPLY=( $(compgen -W "horizontal vertical" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac OPTS="--help --enable --disable --configure --deconfigure --dispatch --rescan --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 } complete -F _chcpu_module chcpu completions/hostnamectl000064400000004351152525375750011367 0ustar00# hostnamectl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # Copyright © 2010 Ran Benita # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . __contains_word () { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done } _hostnamectl() { local i verb comps local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local OPTS='-h --help --version --transient --static --pretty --no-ask-password -H --host -M --machine' if [[ $cur = -* ]]; then COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) return 0 fi local -A VERBS=( [STANDALONE]='status' [ICONS]='set-icon-name' [NAME]='set-hostname set-deployment set-location' [CHASSIS]='set-chassis' ) for ((i=0; i < COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]}; then verb=${COMP_WORDS[i]} break fi done if [[ -z $verb ]]; then comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[CHASSIS]}; then comps='desktop laptop convertible server tablet handset watch embedded vm container' elif __contains_word "$verb" ${VERBS[STANDALONE]} ${VERBS[ICONS]} ${VERBS[NAME]}; then comps='' fi COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 } complete -F _hostnamectl hostnamectl completions/setsid000064400000000670152525375750010341 0ustar00_setsid_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--ctty --wait --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac compopt -o bashdefault COMPREPLY=( $(compgen -c -- $cur) ) return 0 } complete -F _setsid_module setsid completions/bootctl000064400000003621152525375750010513 0ustar00# bootctl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . __contains_word () { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done } _bootctl() { local i verb comps local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local -A OPTS=( [STANDALONE]='-h --help --no-variables -p --print-path --version' [ARG]='--path' ) if [[ "$cur" = -* ]]; then COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) return 0 fi local -A VERBS=( [STANDALONE]='help install list remove status update' ) for ((i=0; i < COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]}; then verb=${COMP_WORDS[i]} break fi done if [[ -z $verb ]]; then comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[STANDALONE]}; then comps='' fi COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 } complete -F _bootctl bootctl completions/resolvectl000064400000015632152525375750011234 0ustar00# resolvectl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . __contains_word () { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done } __get_interfaces(){ { cd /sys/class/net && echo *; } | \ while read -d' ' -r name; do [[ "$name" != "lo" ]] && echo "$name" done } _resolvectl() { local i comps verb name local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local -A OPTS=( [STANDALONE]='-h --help --version --no-pager -4 -6 --service-address=no --service-txt=no --cname=no --search=no --legend=no' [ARG]='-i --interface -p --protocol -t --type -c --class --raw' ) local -A VERBS=( [DOMAIN]='query service openpgp' [FAMILY]='tlsa' [STATUS]='status' [LINK]='revert dns domain nta' [RESOLVE]='llmnr mdns' [DNSSEC]='dnssec' [DNSOVERTLS]='dnsovertls' [STANDALONE]='statistics reset-statistics flush-caches reset-server-features' ) local -A ARGS=( [FAMILY]='tcp udp sctp' [RESOLVE]='yes no resolve' [DNSSEC]='yes no allow-downgrade' [DNSOVERTLS]='no opportunistic' ) local interfaces=$( __get_interfaces ) if __contains_word "$prev" ${OPTS[ARG]}; then case $prev in --interface|-i) comps="$interfaces" ;; --protocol|-p|--type|-t|--class|-c) comps=$( resolvectl --legend=no "$prev" help; echo help ) ;; --raw) comps="payload packet" ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 fi if [[ "$cur" = -* ]]; then COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) return 0 fi for ((i=0; i < COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]} && ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then verb=${COMP_WORDS[i]} break fi done if [[ -z $verb ]]; then comps="${VERBS[*]}" elif __contains_word "$verb" ${VERBS[STANDALONE]} ${VERBS[DOMAIN]}; then comps='' elif __contains_word "$verb" ${VERBS[STATUS]}; then comps="$interfaces" elif __contains_word "$verb" ${VERBS[FAMILY]}; then for ((i++; i < COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" ${ARGS[FAMILY]} && ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then name=${COMP_WORDS[i]} break; fi done if [[ -z $name ]]; then comps=${ARGS[FAMILY]} else comps="" fi elif __contains_word "$verb" ${VERBS[LINK]} ${VERBS[RESOLVE]} ${VERBS[DNSSEC]} ${VERBS[DNSOVERTLS]}; then for ((i++; i < COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" $interfaces && ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then name=${COMP_WORDS[i]} break; fi done if [[ -z $name ]]; then comps="$interfaces" elif __contains_word "$verb" ${VERBS[RESOLVE]}; then name= for ((i++; i < COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" ${ARGS[RESOLVE]} && ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then name=${COMP_WORDS[i]} break; fi done if [[ -z $name ]]; then comps=${ARGS[RESOLVE]} else comps='' fi elif __contains_word "$verb" ${VERBS[DNSSEC]}; then name= for ((i++; i < COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" ${ARGS[DNSSEC]} && ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then name=${COMP_WORDS[i]} break; fi done if [[ -z $name ]]; then comps=${ARGS[DNSSEC]} else comps='' fi elif __contains_word "$verb" ${VERBS[DNSOVERTLS]}; then name= for ((i++; i < COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" ${ARGS[DNSOVERTLS]} && ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then name=${COMP_WORDS[i]} break; fi done if [[ -z $name ]]; then comps=${ARGS[DNSOVERTLS]} else comps='' fi else comps='' fi fi COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 } complete -F _resolvectl resolvectl completions/busctl000064400000017517152525375750010352 0ustar00# busctl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . __contains_word () { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done } __get_machines() { local a b machinectl list --no-legend --no-pager 2>/dev/null | { while read a b; do echo " $a"; done; }; } __get_busnames() { local mode=$1 local a b busctl $mode list --no-legend --no-pager 2>/dev/null | { while read a b; do echo " $a"; done; }; } __get_objects() { local mode=$1 local busname=$2 local a b busctl $mode tree --list --no-legend --no-pager $busname 2>/dev/null | { while read a b; do echo " $a"; done; }; } __get_interfaces() { local mode=$1 local busname=$2 local path=$3 local a b c busctl $mode introspect --list --no-legend --no-pager $busname $path 2>/dev/null | { while read a b c; do [[ "$b" == "interface" ]] && echo " $a"; done; }; } __get_members() { local mode=$1 local busname=$2 local path=$3 local interface=$4 local type=$5 local flags=$6 local a b c d e busctl $mode introspect --list --no-legend --no-pager $busname $path $interface 2>/dev/null | sed -e 's/^\.//' | { while read a b c d e; do [[ "$b" == "$type" && ( -z $flags || "$e" == "$flags" ) ]] && echo " $a"; done; }; } __get_signature() { local mode=$1 local busname=$2 local path=$3 local interface=$4 local member=$5 local a b c d busctl $mode introspect --list --no-legend --no-pager $busname $path $interface 2>/dev/null | sed -e 's/^\.//' | { while read a b c d; do [[ "$a" == "$member" && "$c" != '-' ]] && echo " \"$c\""; done; }; } _busctl() { local i n verb comps mode local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local -A OPTS=( [STANDALONE]='-h --help --version --no-pager --no-legend --system --user --show-machine --unique --acquired --activatable --list -q --quiet --verbose --expect-reply=no --auto-start=no --allow-interactive-authorization=no --augment-creds=no --watch-bind=yes' [ARG]='--address -H --host -M --machine --match --timeout --size' ) if __contains_word "--user" ${COMP_WORDS[*]}; then mode=--user else mode=--system fi if __contains_word "$prev" ${OPTS[ARG]}; then case $prev in --host|-H) comps=$(compgen -A hostname) ;; --machine|-M) comps=$( __get_machines ) esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 fi if [[ "$cur" = -* ]]; then COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) return 0 fi local -A VERBS=( [STANDALONE]='list help' [BUSNAME]='status monitor capture tree' [OBJECT]='introspect' [METHOD]='call' [PROPERTY_GET]='get-property' [PROPERTY_SET]='set-property' ) for ((i=0; i < COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]} && ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then verb=${COMP_WORDS[i]} break fi done n=$(($COMP_CWORD - $i)) if [[ -z $verb ]]; then comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[STANDALONE]}; then comps='' elif __contains_word "$verb" ${VERBS[BUSNAME]}; then comps=$( __get_busnames $mode) elif __contains_word "$verb" ${VERBS[OBJECT]}; then if [[ $n -eq 1 ]] ; then comps=$( __get_busnames $mode) elif [[ $n -eq 2 ]] ; then comps=$( __get_objects $mode ${COMP_WORDS[COMP_CWORD-1]}) elif [[ $n -eq 3 ]] ; then comps=$( __get_interfaces $mode ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]}) else comps='' fi elif __contains_word "$verb" ${VERBS[METHOD]}; then if [[ $n -eq 1 ]] ; then comps=$( __get_busnames $mode) elif [[ $n -eq 2 ]] ; then comps=$( __get_objects $mode ${COMP_WORDS[COMP_CWORD-1]}) elif [[ $n -eq 3 ]] ; then comps=$( __get_interfaces $mode ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]}) elif [[ $n -eq 4 ]] ; then comps=$( __get_members $mode ${COMP_WORDS[COMP_CWORD-3]} ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]} method) elif [[ $n -eq 5 ]] ; then comps=$( __get_signature $mode ${COMP_WORDS[COMP_CWORD-4]} ${COMP_WORDS[COMP_CWORD-3]} ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]}) else comps='' fi elif __contains_word "$verb" ${VERBS[PROPERTY_GET]}; then if [[ $n -eq 1 ]] ; then comps=$( __get_busnames $mode) elif [[ $n -eq 2 ]] ; then comps=$( __get_objects $mode ${COMP_WORDS[COMP_CWORD-1]}) elif [[ $n -eq 3 ]] ; then comps=$( __get_interfaces $mode ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]}) elif [[ $n -eq 4 ]] ; then comps=$( __get_members $mode ${COMP_WORDS[COMP_CWORD-3]} ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]} property) else comps='' fi elif __contains_word "$verb" ${VERBS[PROPERTY_SET]}; then if [[ $n -eq 1 ]] ; then comps=$( __get_busnames $mode) elif [[ $n -eq 2 ]] ; then comps=$( __get_objects $mode ${COMP_WORDS[COMP_CWORD-1]}) elif [[ $n -eq 3 ]] ; then comps=$( __get_interfaces $mode ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]}) elif [[ $n -eq 4 ]] ; then comps=$( __get_members $mode ${COMP_WORDS[COMP_CWORD-3]} ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]} property writable) elif [[ $n -eq 5 ]] ; then comps=$( __get_signature $mode ${COMP_WORDS[COMP_CWORD-4]} ${COMP_WORDS[COMP_CWORD-3]} ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]}) else comps='' fi fi COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 } complete -F _busctl busctl completions/hexdump000064400000001757152525375750010527 0ustar00_hexdump_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-L'|'--color') COMPREPLY=( $(compgen -W "auto never always" -- $cur) ) return 0 ;; '-e'|'--format') COMPREPLY=( $(compgen -W "format" -- $cur) ) return 0 ;; '-n'|'--length') COMPREPLY=( $(compgen -W "length" -- $cur) ) return 0 ;; '-s'|'--skip') COMPREPLY=( $(compgen -W "offset" -- $cur) ) return 0 ;; '-V'|'--version'|'-h'|'--help') return 0 ;; esac case $cur in -*) OPTS=" --one-byte-octal --one-byte-char --canonical --two-bytes-decimal --two-bytes-octal --two-bytes-hex --color= --format --format-file --length --skip --no-squeezing --version --help" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _hexdump_module hexdump completions/timedatectl000064400000005650152525375750011350 0ustar00# timedatectl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # Copyright © 2010 Ran Benita # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . __contains_word () { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done } __get_machines() { local a b machinectl list --no-legend --no-pager | { while read a b; do echo " $a"; done; }; } _timedatectl() { local i verb comps local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local OPTS='-h --help --version --adjust-system-clock --no-pager --no-ask-password -H --host -M --machine --monitor -p --property -a --all --value' if __contains_word "$prev" $OPTS; then case $prev in --host|-H) comps=$(compgen -A hostname) ;; --machine|-M) comps=$( __get_machines ) ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 fi if [[ $cur = -* ]]; then COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) return 0 fi local -A VERBS=( [BOOLEAN]='set-local-rtc set-ntp' [STANDALONE]='status show list-timezones timesync-status show-timesync' [TIMEZONES]='set-timezone' [TIME]='set-time' ) for ((i=0; i < COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]}; then verb=${COMP_WORDS[i]} break fi done if [[ -z $verb ]]; then comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[BOOLEAN]}; then comps='true false' elif __contains_word "$verb" ${VERBS[TIMEZONES]}; then comps=$(command timedatectl list-timezones) elif __contains_word "$verb" ${VERBS[STANDALONE]} ${VERBS[TIME]}; then comps='' fi COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 } complete -F _timedatectl timedatectl completions/losetup000064400000003271152525375750010541 0ustar00_losetup_module() { local cur prev OPTS ARG COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-d'|'--detach') ARG="$($1 --output NAME | awk '{if (1 < NR) {print}}')" COMPREPLY=( $(compgen -W "$ARG" -- $cur) ) return 0 ;; '-j'|'--associated') ARG="$($1 --output BACK-FILE | awk '{if (1 < NR) {print}}')" COMPREPLY=( $(compgen -W "$ARG" -- $cur) ) return 0 ;; '-c'|'--set-capacity') ARG="$(for I in /dev/loop[0-9]*; do if [ -e $I ]; then echo $I; fi; done)" COMPREPLY=( $(compgen -W "$ARG" -- $cur) ) return 0 ;; '-o'|'--offset'|'--sizelimit') COMPREPLY=( $(compgen -W "number" -- $cur) ) return 0 ;; '-O'|'--output') local prefix realcur OUTPUT_ALL OUTPUT realcur="${cur##*,}" prefix="${cur%$realcur}" OUTPUT_ALL="NAME AUTOCLEAR BACK-FILE BACK-INO BACK-MAJ:MIN MAJ:MIN OFFSET PARTSCAN RO SIZELIMIT DIO" for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--all --detach --detach-all --find --set-capacity --associated --nooverlap --offset --sizelimit --partscan --read-only --show --verbose --json --list --noheadings --output --raw --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _losetup_module losetup completions/gdbus000064400000001647152525375750010157 0ustar00 # Check for bash [ -z "$BASH_VERSION" ] && return #################################################################################################### __gdbus() { local IFS=$'\n' local cur=`_get_cword :` local suggestions=$(gdbus complete "${COMP_LINE}" ${COMP_POINT}) COMPREPLY=($(compgen -W "$suggestions" -- "$cur")) # Remove colon-word prefix from COMPREPLY items case "$cur" in *:*) case "$COMP_WORDBREAKS" in *:*) local colon_word=${cur%${cur##*:}} local i=${#COMPREPLY[*]} while [ $((--i)) -ge 0 ]; do COMPREPLY[$i]=${COMPREPLY[$i]#"$colon_word"} done ;; esac ;; esac } #################################################################################################### complete -o nospace -F __gdbus gdbus completions/kernel-install000064400000003422152525375750011770 0ustar00# kernel-install(8) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # Copyright © 2013 Harald Hoyer # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . _kernel_install() { local comps local MACHINE_ID local cur=${COMP_WORDS[COMP_CWORD]} case $COMP_CWORD in 1) comps="add remove" ;; 2) comps=$(cd /lib/modules; echo [0-9]*) if [[ ${COMP_WORDS[1]} == "remove" ]] && [[ -f /etc/machine-id ]]; then read MACHINE_ID < /etc/machine-id if [[ $MACHINE_ID ]] && ( [[ -d /boot/$MACHINE_ID ]] || [[ -L /boot/$MACHINE_ID ]] ); then comps=$(cd "/boot/$MACHINE_ID"; echo [0-9]*) fi fi ;; 3) [[ "$cur" ]] || cur=/lib/modules/${COMP_WORDS[2]}/vmlinuz comps=$(compgen -f -- "$cur") compopt -o filenames ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 } complete -F _kernel_install kernel-install completions/wall000064400000001172152525375750010003 0ustar00_wall_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-t'|'--timeout') COMPREPLY=( $(compgen -W "seconds" -- $cur) ) return 0 ;; '-g'|'--group') COMPREPLY=( $(compgen -A 'group' -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--group --nobanner --timeout --version --help" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _wall_module wall completions/readprofile000064400000001247152525375750011343 0ustar00_readprofile_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-m'|'--mapfile'|'-p'|'--profile') local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 ;; '-M'|'--multiplier') COMPREPLY=( $(compgen -W "multiplier" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac OPTS="--mapfile --profile --multiplier --info --verbose --all --histbin --counters --reset --no-auto --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 } complete -F _readprofile_module readprofile completions/ethtool000064400000057013152525375750010527 0ustar00# bash completion for ethtool(8) -*- shell-script -*- # shellcheck shell=bash disable=SC2207 # Complete a word representing a set of characters. # @param $@ chars Characters which may be present in completed set. _ethtool_compgen_letterset() { local char for char; do case "$cur" in *"$char"*) # $cur already contains $char ;; *) COMPREPLY+=( "$cur$char" ) ;; esac done } # Generate completions for words matched case-insensitively # @param $@ choices Completion choices. _ethtool_compgen_nocase() { local reset reset=$( shopt -p nocasematch ) shopt -s nocasematch local choice for choice; do case "$choice" in "$cur"*) COMPREPLY+=( "$choice" ) ;; esac done $reset } # Gets names from a section of ethtool output. # @param $1 section_bre POSIX BRE matching section heading (without : at end). # @param $@ ethtool arguments _ethtool_get_names_in_section() { local section_bre="$1" shift PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin" \ ethtool "$@" 2>/dev/null | command sed -n " # Line is section heading iff it ends with : # From requested section heading to next section heading /^$section_bre:$/,/:$/ { # If line is section heading, ignore it /:$/d # Remove value and separator, if present s/[[:space:]]*:.*// # Remove leading space, if present s/^[[:space:]]*// # Print the line p }" } # Complete an RSS Context ID _ethtool_context() { COMPREPLY=( $(PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin" \ ethtool --show-nfc "${words[2]}" 2>/dev/null | command sed -n 's/^[[:space:]]*RSS Context ID:[[:space:]]*\([0-9]*\)$/\1/p' | sort -u) ) } # Complete a network flow traffic type # Available OPTIONS: # --hash Complete only types suitable for rx hashing _ethtool_flow_type() { local types='ah4 ah6 esp4 esp6 ether sctp4 sctp6 tcp4 tcp6 udp4 udp6' if [ "${1-}" != --hash ]; then types="$types ip4 ip6" fi COMPREPLY=( $( compgen -W "$types" -- "$cur" ) ) } # Completion for ethtool --change _ethtool_change() { local -A settings=( [advertise]=notseen [autoneg]=notseen [duplex]=notseen [mdix]=notseen [msglvl]=notseen [port]=notseen [phyad]=notseen [speed]=notseen [wol]=notseen [xcvr]=notseen [lanes]=notseen ) local -A msgtypes=( [drv]=notseen [hw]=notseen [ifdown]=notseen [ifup]=notseen [intr]=notseen [link]=notseen [pktdata]=notseen [probe]=notseen [rx_err]=notseen [rx_status]=notseen [timer]=notseen [tx_done]=notseen [tx_err]=notseen [tx_queued]=notseen [wol]=notseen ) # Mark seen settings and msgtypes, and whether in msglvl sub-command local in_msglvl= local word for word in "${words[@]:3:${#words[@]}-4}"; do if [ "$in_msglvl" ] && [ "${msgtypes[$word]+set}" ]; then msgtypes[$word]=seen elif [ "${settings[$word]+set}" ]; then settings[$word]=seen if [ "$word" = msglvl ]; then in_msglvl=1 else in_msglvl= fi fi done if [ "$in_msglvl" ] && [ "${msgtypes[$prev]+set}" ]; then # All msgtypes take an on/off argument COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) return fi case "$prev" in advertise) # Hex number return ;; autoneg) COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) return ;; duplex) COMPREPLY=( $( compgen -W 'half full' -- "$cur" ) ) return ;; mdix) COMPREPLY=( $( compgen -W 'auto on off' -- "$cur" ) ) return ;; msglvl) # Unsigned integer or msgtype COMPREPLY=( $( compgen -W "${!msgtypes[*]}" -- "$cur" ) ) return ;; port) COMPREPLY=( $( compgen -W 'aui bnc fibre mii tp' -- "$cur" ) ) return ;; phyad) # Integer return ;; sopass) _mac_addresses return ;; speed) # Number return ;; wol) # $cur is a set of wol type characters. _ethtool_compgen_letterset p u m b a g s f d return ;; xcvr) COMPREPLY=( $( compgen -W 'internal external' -- "$cur" ) ) return ;; lanes) # Number return ;; esac local -a comp_words=() # Add settings not seen to completions local setting for setting in "${!settings[@]}"; do if [ "${settings[$setting]}" = notseen ]; then comp_words+=( "$setting" ) fi done # Add settings not seen to completions if [ "$in_msglvl" ]; then local msgtype for msgtype in "${!msgtypes[@]}"; do if [ "${msgtypes[$msgtype]}" = notseen ]; then comp_words+=( "$msgtype" ) fi done fi COMPREPLY=( $( compgen -W "${comp_words[*]}" -- "$cur" ) ) } # Completion for ethtool --change-eeprom _ethtool_change_eeprom() { local -A settings=( [length]=1 [magic]=1 [offset]=1 [value]=1 ) if [ "${settings[$prev]+set}" ]; then # All settings take an unsigned integer argument return fi # Remove settings which have been seen local word for word in "${words[@]:3:${#words[@]}-4}"; do unset "settings[$word]" done COMPREPLY=( $( compgen -W "${!settings[*]}" -- "$cur" ) ) } # Completion for ethtool --coalesce _ethtool_coalesce() { local -A settings=( [adaptive-rx]=1 [adaptive-tx]=1 [pkt-rate-high]=1 [pkt-rate-low]=1 [rx-frames]=1 [rx-frames-high]=1 [rx-frames-irq]=1 [rx-frames-low]=1 [rx-usecs]=1 [rx-usecs-high]=1 [rx-usecs-irq]=1 [rx-usecs-low]=1 [sample-interval]=1 [stats-block-usecs]=1 [tx-frames]=1 [tx-frames-high]=1 [tx-frames-irq]=1 [tx-frames-low]=1 [tx-usecs]=1 [tx-usecs-high]=1 [tx-usecs-irq]=1 [tx-usecs-low]=1 ) case "$prev" in adaptive-rx|\ adaptive-tx) COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) return ;; esac if [ "${settings[$prev]+set}" ]; then # Unsigned integer return fi # Remove settings which have been seen local word for word in "${words[@]:3:${#words[@]}-4}"; do unset "settings[$word]" done COMPREPLY=( $( compgen -W "${!settings[*]}" -- "$cur" ) ) } # Completion for ethtool --config-nfc flow-type _ethtool_config_nfc_flow_type() { if [ "$cword" -eq 4 ]; then _ethtool_flow_type --spec return fi case "$prev" in context) _ethtool_context return ;; dst|\ dst-mac|\ src) # TODO: Complete only local for dst and remote for src _mac_addresses return ;; dst-ip) # Note: RX classification, so dst is usually local case "${words[4]}" in *4) _ip_addresses -4 return ;; *6) _ip_addresses -6 return ;; esac return ;; src-ip) # Note: RX classification, so src is usually remote # TODO: Remote IP addresses (ARP cache + /etc/hosts + ?) return ;; m|\ *-mask) # MAC, IP, or integer bitmask return ;; esac local -A settings=( [action]=1 [context]=1 [loc]=1 [queue]=1 [vf]=1 ) if [ "${settings[$prev]+set}" ]; then # Integer return fi case "${words[4]}" in ah4|\ esp4) local -A fields=( [dst-ip]=1 [dst-mac]=1 [spi]=1 [src-ip]=1 [tos]=1 [user-def]=1 [vlan-etype]=1 [vlan]=1 ) ;; ah6|\ esp6) local -A fields=( [dst-ip]=1 [dst-mac]=1 [spi]=1 [src-ip]=1 [tclass]=1 [user-def]=1 [vlan-etype]=1 [vlan]=1 ) ;; ether) local -A fields=( [dst]=1 [proto]=1 [src]=1 [user-def]=1 [vlan-etype]=1 [vlan]=1 ) ;; ip4) local -A fields=( [dst-ip]=1 [dst-mac]=1 [dst-port]=1 [l4data]=1 [l4proto]=1 [spi]=1 [src-ip]=1 [src-port]=1 [tos]=1 [user-def]=1 [vlan-etype]=1 [vlan]=1 ) ;; ip6) local -A fields=( [dst-ip]=1 [dst-mac]=1 [dst-port]=1 [l4data]=1 [l4proto]=1 [spi]=1 [src-ip]=1 [src-port]=1 [tclass]=1 [user-def]=1 [vlan-etype]=1 [vlan]=1 ) ;; sctp4|\ tcp4|\ udp4) local -A fields=( [dst-ip]=1 [dst-mac]=1 [dst-port]=1 [src-ip]=1 [src-port]=1 [tos]=1 [user-def]=1 [vlan-etype]=1 [vlan]=1 ) ;; sctp6|\ tcp6|\ udp6) local -A fields=( [dst-ip]=1 [dst-mac]=1 [dst-port]=1 [src-ip]=1 [src-port]=1 [tclass]=1 [user-def]=1 [vlan-etype]=1 [vlan]=1 ) ;; *) return ;; esac if [ "${fields[$prev]+set}" ]; then # Integer return fi # If the previous 2 words were a field+value, suggest a mask local mask= if [ "${fields[${words[$cword-2]}]+set}" ]; then mask="m ${words[$cword-2]}-mask" fi # Remove fields and settings which have been seen local word for word in "${words[@]:5:${#words[@]}-6}"; do unset "fields[$word]" "settings[$word]" done # Remove mutually-exclusive options if ! [ "${settings[action]+set}" ]; then unset 'settings[queue]' 'settings[vf]' fi if ! [ "${settings[queue]+set}" ]; then unset 'settings[action]' fi if ! [ "${settings[vf]+set}" ]; then unset 'settings[action]' fi COMPREPLY=( $( compgen -W "$mask ${!fields[*]} ${!settings[*]}" -- "$cur" ) ) } # Completion for ethtool --config-nfc _ethtool_config_nfc() { if [ "$cword" -eq 3 ]; then COMPREPLY=( $( compgen -W 'delete flow-type rx-flow-hash' -- "$cur" ) ) return fi case "${words[3]}" in delete) # Unsigned integer return ;; flow-type) _ethtool_config_nfc_flow_type return ;; rx-flow-hash) case "$cword" in 4) _ethtool_flow_type --hash return ;; 5) _ethtool_compgen_letterset m v t s d f n r return ;; 6) COMPREPLY=( $( compgen -W context -- "$cur" ) ) return ;; 7) _ethtool_context return ;; esac return ;; esac } # Completion for ethtool --eeprom-dump _ethtool_eeprom_dump() { local -A settings=( [length]=1 [offset]=1 [raw]=1 ) if [ "$prev" = raw ]; then COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) return fi if [ "${settings[$prev]+set}" ]; then # Unsigned integer argument return fi # Remove settings which have been seen local word for word in "${words[@]:3:${#words[@]}-4}"; do unset "settings[$word]" done COMPREPLY=( $( compgen -W "${!settings[*]}" -- "$cur" ) ) } # Completion for ethtool --features _ethtool_features() { local -A abbreviations=( [generic-receive-offload]=gro [generic-segmentation-offload]=gso [large-receive-offload]=lro [ntuple-filters]=ntuple [receive-hashing]=rxhash [rx-checksumming]=rx [rx-vlan-offload]=rxvlan [scatter-gather]=sg [tcp-segmentation-offload]=tso [tx-checksumming]=tx [tx-vlan-offload]=txvlan [udp-fragmentation-offload]=ufo ) local -A features=() local feature status fixed # shellcheck disable=SC2034 while read -r feature status fixed; do if [ -z "$feature" ]; then # Ignore blank line from empty expansion in here-document continue fi if [ "$feature" = Features ]; then # Ignore heading continue fi if [ "$fixed" = '[fixed]' ]; then # Fixed features can't be changed continue fi feature=${feature%:} if [ "${abbreviations[$feature]+set}" ]; then features[${abbreviations[$feature]}]=1 else features[$feature]=1 fi done </dev/null) ETHTOOL_FEATURES if [ "${features[$prev]+set}" ]; then COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) return fi # Remove features which have been seen local word for word in "${words[@]:3:${#words[@]}-4}"; do unset "features[$word]" done COMPREPLY=( $( compgen -W "${!features[*]}" -- "$cur" ) ) } # Complete the current word as a kernel firmware file (for request_firmware) # See https://www.kernel.org/doc/html/latest/driver-api/firmware/core.html _ethtool_firmware() { local -a firmware_paths=( /lib/firmware/updates/ /lib/firmware/ ) local release if release=$( uname -r 2>/dev/null ); then firmware_paths+=( "/lib/firmware/updates/$release/" "/lib/firmware/$release/" ) fi local fw_path_para if fw_path_para=$( cat /sys/module/firmware_class/parameters/path 2>/dev/null ) \ && [ -n "$fw_path_para" ]; then firmware_paths+=( "$fw_path_para" ) fi local -A firmware_files=() local firmware_path for firmware_path in "${firmware_paths[@]}"; do local firmware_file for firmware_file in "$firmware_path"*; do if [ -f "$firmware_file" ]; then firmware_files[${firmware_file##*/}]=1 fi done done local IFS=' ' COMPREPLY=( $( compgen -W "${!firmware_files[*]}" -- "$cur" ) ) } # Completion for ethtool --flash _ethtool_flash() { if [ "$cword" -eq 3 ]; then _ethtool_firmware return fi } # Completion for ethtool --get-dump _ethtool_get_dump() { case "$cword" in 3) COMPREPLY=( $( compgen -W data -- "$cur" ) ) return ;; 4) # Output filename local IFS=' ' COMPREPLY=( $( compgen -f -- "$cur" ) ) return ;; esac } # Completion for ethtool --get-phy-tunable _ethtool_get_phy_tunable() { if [ "$cword" -eq 3 ]; then COMPREPLY=( $( compgen -W downshift -- "$cur" ) ) return fi } # Completion for ethtool --module-info _ethtool_module_info() { local -A settings=( [hex]=1 [length]=1 [offset]=1 [raw]=1 ) case "$prev" in hex|\ raw) COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) return ;; esac if [ "${settings[$prev]+set}" ]; then # Unsigned integer argument return fi # Remove settings which have been seen local word for word in "${words[@]:3:${#words[@]}-4}"; do unset "settings[$word]" done COMPREPLY=( $( compgen -W "${!settings[*]}" -- "$cur" ) ) } # Completion for ethtool --pause _ethtool_pause() { local -A settings=( [autoneg]=1 [rx]=1 [tx]=1 ) if [ "${settings[$prev]+set}" ]; then COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) return fi # Remove settings which have been seen local word for word in "${words[@]:3:${#words[@]}-4}"; do unset "settings[$word]" done COMPREPLY=( $( compgen -W "${!settings[*]}" -- "$cur" ) ) } # Completion for ethtool --per-queue _ethtool_per_queue() { local -a subcommands=( --coalesce --show-coalesce ) if [ "$cword" -eq 3 ]; then COMPREPLY=( $( compgen -W "queue_mask ${subcommands[*]}" -- "$cur" ) ) return fi local sc_start=3 if [ "${words[3]}" = queue_mask ] ; then case "$cword" in 4) # Hex number return ;; 5) COMPREPLY=( $( compgen -W "${subcommands[*]}" -- "$cur" ) ) return ;; esac sc_start=5 fi case "${words[$sc_start]}" in --coalesce) # Remove --per-queue args to match normal --coalesce invocation local words=( "${words[0]}" --coalesce "${words[2]}" "${words[@]:$sc_start+1:${#words[@]}-$sc_start-1}" ) _ethtool_coalesce return ;; --show-coalesce) # No args return ;; esac } # Completion for ethtool --register-dump _ethtool_register_dump() { local -A settings=( [file]=1 [hex]=1 [raw]=1 ) case "$prev" in hex|\ raw) COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) return ;; file) local IFS=' ' COMPREPLY=( $( compgen -f -- "$cur" ) ) return ;; esac # Remove settings which have been seen local word for word in "${words[@]:3:${#words[@]}-4}"; do unset "settings[$word]" done COMPREPLY=( $( compgen -W "${!settings[*]}" -- "$cur" ) ) } # Completion for ethtool --reset _ethtool_reset() { if [ "$prev" = flags ]; then # Unsigned integer return fi local -A flag_names=( [ap]=1 [dma]=1 [filter]=1 [irq]=1 [mac]=1 [mgmt]=1 [offload]=1 [phy]=1 [ram]=1 ) local -A all_flag_names=() local flag_name for flag_name in "${!flag_names[@]}"; do all_flag_names[$flag_name]=1 all_flag_names[$flag_name-shared]=1 done # Remove all_flag_names which have been seen local any_dedicated= local word for word in "${words[@]:3:${#words[@]}-4}"; do case "$word" in all) # Flags are always additive. # Nothing to add after "all". return ;; dedicated) any_dedicated=1 # "dedicated" sets all non-shared flags for flag_name in "${!flag_names[@]}"; do unset "all_flag_names[$flag_name]" done continue ;; esac if [ "${flag_names[$word]+set}" ]; then any_dedicated=1 fi unset "all_flag_names[$word]" done COMPREPLY=( $( compgen -W "${!all_flag_names[*]}" -- "$cur" ) ) # Although it is permitted to mix named and un-named flags or duplicate # flags with "all" or "dedicated", it's not likely intentional. # Reconsider if a real use-case (or good consistency argument) is found. if [ "$cword" -eq 3 ]; then COMPREPLY+=( all dedicated flags ) elif [ -z "$any_dedicated" ]; then COMPREPLY+=( dedicated ) fi } # Completion for ethtool --rxfh _ethtool_rxfh() { local -A settings=( [context]=1 [default]=1 [delete]=1 [equal]=1 [hfunc]=1 [hkey]=1 [weight]=1 ) case "$prev" in context) _ethtool_context # "new" to create a new context COMPREPLY+=( new ) return ;; equal) # Positive integer return ;; hfunc) # Complete available RSS hash functions COMPREPLY=( $(_ethtool_get_names_in_section 'RSS hash function' \ --show-rxfh "${words[2]}") ) return ;; hkey) # Pairs of hex digits separated by : return ;; weight) # Non-negative integer return ;; esac local word for word in "${words[@]:3:${#words[@]}-4}"; do # Remove settings which have been seen unset "settings[$word]" # Remove settings which are mutually-exclusive with seen settings case "$word" in context) unset 'settings[default]' ;; default) unset \ 'settings[context]' \ 'settings[delete]' \ 'settings[equal]' \ 'settings[weight]' ;; delete) unset \ 'settings[default]' \ 'settings[equal]' \ 'settings[hkey]' \ 'settings[weight]' ;; equal) unset \ 'settings[default]' \ 'settings[delete]' \ 'settings[weight]' ;; hkey) unset 'settings[delete]' ;; weight) unset \ 'settings[default]' \ 'settings[delete]' \ 'settings[equal]' ;; esac done COMPREPLY=( $( compgen -W "${!settings[*]}" -- "$cur" ) ) } # Completion for ethtool --set-channels _ethtool_set_channels() { local -A settings=( [combined]=1 [other]=1 [rx]=1 [tx]=1 ) if [ "${settings[$prev]+set}" ]; then # Unsigned integer argument return fi # Remove settings which have been seen local word for word in "${words[@]:3:${#words[@]}-4}"; do unset "settings[$word]" done COMPREPLY=( $( compgen -W "${!settings[*]}" -- "$cur" ) ) } # Completion for ethtool --set-eee _ethtool_set_eee() { local -A settings=( [advertise]=1 [eee]=1 [tx-lpi]=1 [tx-timer]=1 ) case "$prev" in advertise|\ tx-timer) # Unsigned integer return ;; eee|\ tx-lpi) COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) return ;; esac # Remove settings which have been seen local word for word in "${words[@]:3:${#words[@]}-4}"; do unset "settings[$word]" done COMPREPLY=( $( compgen -W "${!settings[*]}" -- "$cur" ) ) } # Completion for ethtool --set-fec _ethtool_set_fec() { if [ "$cword" -eq 3 ]; then COMPREPLY=( $( compgen -W encoding -- "$cur" ) ) return fi local -A modes=( [auto]=auto [rs]=RS [off]=off [baser]=BaseR ) # Remove modes which have been seen local word for word in "${words[@]:3:${#words[@]}-4}"; do # ethtool recognizes modes case-insensitively unset "modes[${word,,}]" done _ethtool_compgen_nocase "${modes[@]}" } # Completion for ethtool --set-phy-tunable _ethtool_set_phy_tunable() { case "$cword" in 3) COMPREPLY=( $( compgen -W downshift -- "$cur" ) ) return ;; 4) COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) return ;; 5) COMPREPLY=( $( compgen -W count -- "$cur" ) ) return ;; esac } # Completion for ethtool --set-priv-flags _ethtool_set_priv_flags() { if [ $(( cword % 2 )) -eq 0 ]; then COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) return fi # Get available private flags local -A flags=() local flag while IFS= read -r flag; do # Ignore blank line from empty here-document if [ -n "$flag" ]; then flags[$flag]=1 fi done </dev/null | command sed -n 's/^Filter:[[:space:]]*\([0-9]*\)$/\1/p') ) fi return ;; rx-flow-hash) case "$cword" in 4) _ethtool_flow_type --hash return ;; 5) COMPREPLY=( $( compgen -W context -- "$cur" ) ) return ;; 6) _ethtool_context return ;; esac ;; esac } # Completion for ethtool --show-rxfh _ethtool_show_rxfh() { case "$cword" in 3) COMPREPLY=( $( compgen -W context -- "$cur" ) ) return ;; 4) _ethtool_context return ;; esac } # Completion for ethtool --test _ethtool_test() { if [ "$cword" -eq 3 ]; then COMPREPLY=( $( compgen -W 'external_lb offline online' -- "$cur" ) ) return fi } # Complete any ethtool command _ethtool() { local cur prev words cword _init_completion || return # Per "Contributing to bash-completion", complete non-duplicate long opts local -A suggested_funcs=( [--change-eeprom]=change_eeprom [--change]=change [--coalesce]=coalesce [--config-nfc]=config_nfc [--driver]=devname [--dump-module-eeprom]=module_info [--eeprom-dump]=eeprom_dump [--features]=features [--flash]=flash [--get-dump]=get_dump [--get-phy-tunable]=get_phy_tunable [--identify]=devname [--module-info]=module_info [--negotiate]=devname [--offload]=features [--pause]=pause [--per-queue]=per_queue [--phy-statistics]=devname [--register-dump]=register_dump [--reset]=reset [--set-channels]=set_channels [--set-dump]=devname [--set-eee]=set_eee [--set-fec]=set_fec [--set-phy-tunable]=set_phy_tunable [--set-priv-flags]=set_priv_flags [--set-ring]=set_ring [--set-rxfh-indir]=rxfh [--show-channels]=devname [--show-coalesce]=devname [--show-eee]=devname [--show-features]=devname [--show-fec]=devname [--show-nfc]=show_nfc [--show-offload]=devname [--show-pause]=devname [--show-permaddr]=devname [--show-priv-flags]=devname [--show-ring]=devname [--show-rxfh]=show_rxfh [--show-time-stamping]=devname [--statistics]=devname [--test]=test ) local -A other_funcs=( [--config-ntuple]=config_nfc [--rxfh]=rxfh [--show-ntuple]=show_nfc [--show-rxfh-indir]=devname [-A]=pause [-C]=coalesce [-E]=change_eeprom [-G]=set_ring [-K]=features [-L]=set_channels [-N]=config_nfc [-P]=devname [-Q]=per_queue [-S]=devname [-T]=devname [-U]=config_nfc [-W]=devname [-X]=rxfh [-a]=devname [-c]=devname [-d]=register_dump [-e]=eeprom_dump [-f]=flash [-g]=devname [-i]=devname [-k]=devname [-l]=devname [-m]=module_info [-n]=show_nfc [-p]=devname [-r]=devname [-s]=change [-t]=test [-u]=show_nfc [-w]=get_dump [-x]=devname ) if [ "$cword" -le 1 ]; then _available_interfaces COMPREPLY+=( $( compgen -W "--help --version ${!suggested_funcs[*]}" -- "$cur" ) ) return fi local func=${suggested_funcs[${words[1]}]-${other_funcs[${words[1]}]-}} if [ "$func" ]; then # All sub-commands have devname as their first argument if [ "$cword" -eq 2 ]; then _available_interfaces return fi if [ "$func" != devname ]; then "_ethtool_$func" fi fi } && complete -F _ethtool ethtool # ex: filetype=sh sts=8 sw=8 ts=8 noet completions/setpriv000064400000004502152525375750010540 0ustar00_setpriv_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '--ambient-caps'|'--inh-caps'|'--bounding-set') local prefix realcur INHERIT_ALL INHERIT realcur="${cur##*,}" prefix="${cur%$realcur}" INHERIT_ALL=$($1 --list-caps| awk '{print $1, "-" $1}') for WORD in $INHERIT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then INHERIT="$WORD ${INHERIT:-""}" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$INHERIT" -S ',' -- $realcur) ) return 0 ;; '--ruid'|'--euid'|'--reuid') local UIDS UIDS=$(getent passwd | awk -F: '{print $3}') COMPREPLY=( $(compgen -W "$UIDS" -- $cur) ) return 0 ;; '--rgid'|'--egid'|'--regid') local GIDS GIDS=$(getent group | awk -F: '{print $3}') COMPREPLY=( $(compgen -W "$GIDS" -- $cur) ) return 0 ;; '--groups') local prefix realcur GIDS_ALL GIDS realcur="${cur##*,}" prefix="${cur%$realcur}" GIDS_ALL=$(getent group | awk -F: '{print $3}') for WORD in $GIDS_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then GIDS="$WORD $GIDS" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$GIDS" -S ',' -- $realcur) ) return 0 ;; '--securebits') local SBITS SBITS="noroot noroot_locked no_setuid_fixup no_setuid_fixup_locked keep_caps_locked -noroot -noroot_locked -no_setuid_fixup -no_setuid_fixup_locked -keep_caps_locked" COMPREPLY=( $(compgen -W "$SBITS" -- $cur) ) return 0 ;; '--selinux-label') # FIXME: how to list selinux labels? COMPREPLY=( $(compgen -W "label" -- $cur) ) return 0 ;; '--apparmor-profile') # FIXME: how to list apparmor profiles? COMPREPLY=( $(compgen -W "profile" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--dump --no-new-privs --ambient-caps --inh-caps --bounding-set --ruid --euid --rgid --egid --reuid --regid --clear-groupsclear --keep-groupskeep --groups --securebits --selinux-label --apparmor-profile --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac compopt -o bashdefault COMPREPLY=( $(compgen -c -- $cur) ) return 0 } complete -F _setpriv_module setpriv completions/journalctl000064400000013404152525375750011222 0ustar00# journalctl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # Copyright © 2010 Ran Benita # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . __contains_word () { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done } __get_machines() { local a b (machinectl list-images --no-legend --no-pager; machinectl list --no-legend --no-pager; echo ".host") | \ { while read a b; do echo " $a"; done; } | sort -u; } __syslog_priorities=(emerg alert crit err warning notice info debug) _journalctl() { local field_vals= cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local -A OPTS=( [STANDALONE]='-a --all --full --system --user --disk-usage -f --follow --header -h --help -l --local --new-id128 -m --merge --no-pager --no-tail -q --quiet --setup-keys --verify --version --list-catalog --update-catalog --list-boots --show-cursor --dmesg -k --pager-end -e -r --reverse --utc -x --catalog --no-full --force --dump-catalog --flush --rotate --sync --no-hostname -N --fields' [ARG]='-b --boot -D --directory --file -F --field -t --identifier -M --machine -o --output -u --unit --user-unit -p --priority --root' [ARGUNKNOWN]='-c --cursor --interval -n --lines -S --since -U --until --after-cursor --verify-key --vacuum-size --vacuum-time --vacuum-files --output-fields' ) if __contains_word "$prev" ${OPTS[ARG]} ${OPTS[ARGUNKNOWN]}; then case $prev in --boot|-b) comps=$(journalctl -F '_BOOT_ID' 2>/dev/null) ;; --directory|-D|--root) comps=$(compgen -d -- "$cur") compopt -o filenames ;; --file) comps=$(compgen -f -- "$cur") compopt -o filenames ;; --output|-o) comps='short short-full short-iso short-iso-precise short-precise short-monotonic short-unix verbose export json json-pretty json-sse cat with-unit' ;; --field|-F) comps=$(journalctl --fields | sort 2>/dev/null) ;; --machine|-M) comps=$( __get_machines ) ;; --priority|-p) comps=${__syslog_priorities[*]} ;; --unit|-u) comps=$(journalctl -F '_SYSTEMD_UNIT' 2>/dev/null) ;; --user-unit) comps=$(journalctl -F '_SYSTEMD_USER_UNIT' 2>/dev/null) ;; --identifier|-t) comps=$(journalctl -F 'SYSLOG_IDENTIFIER' 2>/dev/null) ;; *) return 0 ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 fi if [[ $cur = -* ]]; then COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) return 0 elif [[ $cur = *=* ]]; then mapfile -t field_vals < <(journalctl -F "${prev%=}" 2>/dev/null) COMPREPLY=( $(compgen -W '${field_vals[*]}' -- "${cur#=}") ) elif [[ $cur = /dev* ]]; then compopt -o filenames COMPREPLY=( $(compgen -f -- "${cur}") ) elif [[ $cur = /* ]]; then # Append /dev/ to the list of completions, so that # after typing / the user sees /dev/ as one # of the alternatives. Later on the rule above will # take care of showing device files in /dev/. mapfile -t field_vals < <(journalctl -F "_EXE" 2>/dev/null; echo '/dev/') COMPREPLY=( $(compgen -W '${field_vals[*]}' -- "${cur}") ) if [[ "${COMPREPLY[@]}" = '/dev/' ]]; then compopt -o filenames COMPREPLY=( $(compgen -f -- "${cur}") ) fi elif [[ $prev = '=' ]]; then mapfile -t field_vals < <(journalctl -F "${COMP_WORDS[COMP_CWORD-2]}" 2>/dev/null) COMPREPLY=( $(compgen -W '${field_vals[*]}' -- "$cur") ) else mapfile -t field_vals < <(journalctl --fields 2>/dev/null) compopt -o nospace COMPREPLY=( $(compgen -W '${field_vals[*]}' -S= -- "$cur") ) fi } complete -F _journalctl journalctl completions/lsipc000064400000002436152525375750010162 0ustar00_lsipc_module() { local cur prev OPTS ARG COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-i'|'--id') COMPREPLY=( $(compgen -W "id" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; '--time-format') COMPREPLY=( $(compgen -W "short full iso" -- $cur) ) return 0 ;; '-o'|'--output') local prefix realcur OUTPUT_ALL OUTPUT realcur="${cur##*,}" prefix="${cur%$realcur}" OUTPUT_ALL=" KEY ID OWNER PERMS CUID CUSER CGID CGROUP UID USER GID GROUP CTIME SIZE NATTCH STATUS ATTACH DETACH COMMAND CPID LPID USEDBYTES MSGS SEND RECV LSPID LRPID NSEMS OTIME RESOURCE DESCRIPTION LIMIT USED USE% " for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) ) return 0 ;; esac OPTS=" --shmems --queues --semaphores --global --id --noheadings --notruncate --time-format --bytes --creator --export --json --newline --list --output --numeric-perms --raw --time --help --version " COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 } complete -F _lsipc_module lsipc completions/firewall-cmd000064400000024554152525375750011423 0ustar00# bash completion for firewall-cmd -*- shell-script -*- # Copyright (C) 2013 Red Hat, Inc. # # Authors: # Jiri Popelka # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # TODO: find a way how to get the following options from firewall-cmd OPTIONS_LOCKDOWN="--add-lockdown-whitelist-command= --remove-lockdown-whitelist-command= \ --query-lockdown-whitelist-command= --list-lockdown-whitelist-commands \ --add-lockdown-whitelist-context= --remove-lockdown-whitelist-context= \ --query-lockdown-whitelist-context= --list-lockdown-whitelist-contexts \ --add-lockdown-whitelist-uid= --remove-lockdown-whitelist-uid= \ --query-lockdown-whitelist-uid= --list-lockdown-whitelist-uids \ --add-lockdown-whitelist-user= --remove-lockdown-whitelist-user= \ --query-lockdown-whitelist-user= --list-lockdown-whitelist-users" # can be used as standalone or with --permanent OPTIONS_CONFIG="--get-zones --get-services --get-icmptypes --get-helpers \ ${OPTIONS_LOCKDOWN} --list-all-zones \ --info-zone= --info-service= --info-icmptype= \ --info-ipset= --info-helper=" OPTIONS_ZONE_INTERFACES_SOURCES="\ --add-interface= --remove-interface= --query-interface= \ --list-interfaces --change-interface= --change-zone= \ --add-source= --remove-source= --query-source= \ --change-source= --list-sources" OPTIONS_ZONE_ACTION_ACTION="--add-service= --remove-service= --query-service= \ --add-port= --remove-port= --query-port= \ --add-source-port= --remove-source-port= --query-source-port= \ --add-protocol= --remove-protocol= --query-protocol= \ --add-icmp-block= --remove-icmp-block= --query-icmp-block= \ --add-forward-port= --remove-forward-port= --query-forward-port=" OPTIONS_ZONE_ADAPT_QUERY="--add-rich-rule= --remove-rich-rule= --query-rich-rule= \ --add-icmp-block-inversion --remove-icmp-block-inversion \ --query-icmp-block-inversion \ --add-forward --remove-forward --query-forward \ --add-masquerade --remove-masquerade --query-masquerade \ --list-services --list-ports --list-protocols \ --list-source-ports --list-icmp-blocks \ --list-forward-ports --list-rich-rules --list-all" OPTIONS_ZONE_PERMANENT_ONLY="--get-description --get-short \ --set-description= --set-short=" OPTIONS_IPSET_ACTION_ACTION="--add-entry= --remove-entry= --query-entry= --add-entries-from-file= --remove-entries-from-file" OPTIONS_IPSET_ADAPT_QUERY="--list-entries" # can be used with/without preceding --zone= OPTIONS_ZONE="${OPTIONS_ZONE_INTERFACES_SOURCES} \ ${OPTIONS_ZONE_ACTION_ACTION} ${OPTIONS_ZONE_ADAPT_QUERY} ${OPTIONS_ZONE_PERMANENT_ONLY}" OPTIONS_IPSET="${OPTIONS_IPSET_ACTION_ACTION} ${OPTIONS_IPSET_ADAPT_QUERY}" OPTIONS_PERMANENT_ONLY="--new-icmptype= --new-icmptype-from-file= --delete-icmptype= \ --new-service= --new-service-from-file= --delete-service= \ --new-zone= --new-zone-from-file= --delete-zone= \ --load-zone-defaults= \ --new-ipset= --new-helper-from-file= --delete-ipset= \ --new-helper= --new-helper-from-file= --delete-helper= \ --get-target --set-target= \ --path-zone= --path-service= --path-icmptype= \ --path-ipset= --path-helper=" OPTIONS_NEW_IPSET="--type= --option=" OPTIONS_NEW_HELPER="--module= --family=" OPTIONS_HELPER="" # can be used after --permanent OPTIONS_PERMANENT="${OPTIONS_CONFIG} --zone= ${OPTIONS_ZONE} \ ${OPTIONS_PERMANENT_ONLY}" OPTIONS_DIRECT="--passthrough \ --add-chain --remove-chain --query-chain --get-chains --get-all-chains \ --add-rule --remove-rule --remove-rules --query-rule --get-rules --get-all-rules \ --add-passthrough --remove-passthrough \ --query-passthrough --get-passthroughs --get-all-passthroughs" # these all can be used as a "first" option OPTIONS_GENERAL="--help --version \ --state --reload --complete-reload \ --runtime-to-permanent --check-config \ --panic-on --panic-off --query-panic \ --get-log-denied --set-log-denied= --get-ipset-types \ --lockdown-on --lockdown-off --query-lockdown \ --get-default-zone --set-default-zone= --get-active-zones \ --get-zone-of-interface= --get-zone-of-interface= \ ${OPTIONS_CONFIG} \ --zone= ${OPTIONS_ZONE} \ --permanent --direct" _firewall_cmd() { local cur prev words cword split _init_completion -s || return case $prev in --*-entries-from-file|--new-*-from-file) _filedir return ;; --new-ipset*) if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W "${OPTIONS_NEW_IPSET}" -- "$cur") ) fi ;; --new-helper*) if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W "${OPTIONS_NEW_HELPER}" -- "$cur") ) fi ;; --new-*) ;; --zone|--set-default-zone|--info-zone|--path-zone|--load-zone-defaults|--delete-zone) if [[ ${words[@]} == *--permanent* ]]; then COMPREPLY=( $( compgen -W '`firewall-cmd --permanent --get-zones`' -- "$cur" ) ) else COMPREPLY=( $( compgen -W '`firewall-cmd --get-zones`' -- "$cur" ) ) fi ;; --zone=*) COMPREPLY=( $( compgen -W "${OPTIONS_ZONE}" -- "$cur" ) ) ;; --ipset=*) COMPREPLY=( $( compgen -W "${OPTIONS_IPSET}" -- "$cur" ) ) ;; --*-ipset) if [[ ${words[@]} == *--permanent* ]]; then COMPREPLY=( $( compgen -W '`firewall-cmd --permanent --get-ipsets`' -- "$cur" ) ) else COMPREPLY=( $( compgen -W '`firewall-cmd --get-ipsets`' -- "$cur" ) ) fi ;; --*-service) if [[ ${words[@]} == *--permanent* ]]; then COMPREPLY=( $( compgen -W '`firewall-cmd --permanent --get-services`' -- "$cur" ) ) else COMPREPLY=( $( compgen -W '`firewall-cmd --get-services`' -- "$cur" ) ) fi ;; --helper|--info-helper|--path-helper) if [[ ${words[@]} == *--permanent* ]]; then COMPREPLY=( $( compgen -W '`firewall-cmd --permanent --get-helpers`' -- "$cur" ) ) else COMPREPLY=( $( compgen -W '`firewall-cmd --get-helpers`' -- "$cur" ) ) fi ;; --helper=*) COMPREPLY=( $( compgen -W "${OPTIONS_HELPER}" -- "$cur" ) ) ;; --*-icmp-block|--info-icmptype|--path-icmptype) if [[ ${words[@]} == *--permanent* ]]; then COMPREPLY=( $( compgen -W '`firewall-cmd --permanent --get-icmptypes`' -- "$cur" ) ) else COMPREPLY=( $( compgen -W '`firewall-cmd --get-icmptypes`' -- "$cur" ) ) fi ;; --list-services|--add-service=*|--remove-service=*|--query-service=*|\ --list-ports|--add-port=*|--remove-port=*|--query-port=*|\ --list-source-ports|--add-source-port=*|--remove-source-port=*|--query-source-port=*|\ --list-protocols|--add-protocol=*|--remove-protocol=*|--query-protocol=*|\ --list-icmp-blocks|--add-icmp-block=*|--remove-icmp-block=*|--query-icmp-block=*|\ --list-forward-ports|--add-forward-port=*|--remove-forward-port=*|--query-forward-port=*|\ --list-interfaces|--add-interface=*|--remove-interface=*|--query-interface=*|\ --list-sources|--add-source=*|--remove-source=*|--query-source=*|\ --add-forward|--remove-forward|--query-forward|\ --add-masquerade|--remove-masquerade|--query-masquerade|--list-all|\ --get-description|--get-short|--set-description=*|--set-short=*) opts="" # --add and --remove can be used multiple times if [[ ( ${prev} == --add-* ) || ( ${prev} == --remove-* ) ]]; then [[ ${prev} == *=* ]] && opts="${prev%=*}=" || opts="${prev}" fi if [[ ! ${words[@]} == *--permanent* ]]; then opts="${opts} --permanent" [[ ${prev} == --add-* ]] && opts="${opts} --timeout=" fi [[ ! ${words[@]} == *--zone=* ]] && opts="${opts} --zone=" if [ -n "${opts}" ]; then COMPREPLY=( $( compgen -W "${opts}" -- "$cur" ) ) fi ;; --*-interface|--change-zone) _available_interfaces ;; --permanent) [[ ${words[@]} == *--direct* ]] && opts="${OPTIONS_DIRECT}" || opts="${OPTIONS_PERMANENT} --direct" COMPREPLY=( $( compgen -W "${opts}" -- "$cur" ) ) ;; --direct) [[ ${words[@]} == *--permanent* ]] && opts="${OPTIONS_DIRECT}" || opts="${OPTIONS_DIRECT} --permanent" COMPREPLY=( $( compgen -W "${opts}" -- "$cur" ) ) ;; --*-rich-rule) # to not be matched with --*-rule below return 0 ;; --passthrough|--*-chain|--get-chains|--*-rule|--get-rules|--remove-rules) COMPREPLY=( $( compgen -W 'ipv4 ipv6 eb' -- "$cur" ) ) ;; ipv4|ipv6|eb) if [[ ${words[@]} == *--passthrough* ]]; then return 0 else COMPREPLY=( $( compgen -W 'nat filter mangle' -- "$cur" ) ) fi ;; *) if [[ "$cur" == -* ]]; then if [[ ${words[@]} == *--new-ipset* ]]; then COMPREPLY=( $( compgen -W "${OPTIONS_NEW_IPSET}" -- "$cur") ) else COMPREPLY=( $( compgen -W "${OPTIONS_GENERAL}" -- "$cur") ) fi fi ;; esac # do not append a space to words that end with = [[ $COMPREPLY == *= ]] && compopt -o nospace } && complete -F _firewall_cmd firewall-cmd completions/swapon000064400000002771152525375750010361 0ustar00_swapon_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-p'|'--priority') # Priority range is -1 to 32767. Perhaps these # few are enough. COMPREPLY=( $(compgen -W "{-1..9} 32767" -- $cur) ) return 0 ;; '--show') local prefix realcur OUTPUT_ALL OUTPUT realcur="${cur##*,}" prefix="${cur%$realcur}" OUTPUT_ALL="NAME TYPE SIZE USED PRIO UUID LABEL" for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) ) return 0 ;; '-U') local UUIDS UUIDS="$(lsblk -nrp -o FSTYPE,UUID | awk '$1 ~ /swap/ { print $2 }')" COMPREPLY=( $(compgen -W "$UUIDS" -- $cur) ) return 0 ;; '-L') local LABELS LABELS="$(lsblk -nrp -o FSTYPE,LABEL | awk '$1 ~ /swap/ { print $2 }')" COMPREPLY=( $(compgen -W "$LABELS" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--all --discard --ifexists --fixpgsz --priority --summary --show --noheadings --raw --bytes --verbose --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local DEVS DEVS="$(lsblk -nrp -o FSTYPE,NAME | awk '$1 ~ /swap/ { print $2 }')" COMPREPLY=( $(compgen -W "$DEVS" -- $cur) ) return 0 } complete -F _swapon_module swapon completions/udevadm000064400000007266152525375750010503 0ustar00# udevadm(8) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # Copyright © 2010 Ran Benita # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . __contains_word () { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done } __get_all_sysdevs() { local -a devs=(/sys/bus/*/devices/*/ /sys/class/*/*/) printf '%s\n' "${devs[@]%/}" } _udevadm() { local i verb comps local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local OPTS='-h --help --version --debug' local verbs=(info trigger settle control monitor hwdb test-builtin test) for ((i=0; i < COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" "${verbs[@]}" && ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then verb=${COMP_WORDS[i]} break fi done if [[ -z $verb ]]; then COMPREPLY=( $(compgen -W '${OPTS[*]} ${verbs[*]}' -- "$cur") ) return 0 fi case $verb in 'info') if [[ $cur = -* ]]; then comps='--help --query= --path= --name= --root --attribute-walk --export-db --cleanup-db' else comps=$( __get_all_sysdevs ) fi ;; 'trigger') comps='--help --verbose --dry-run --type= --action= --subsystem-match= --subsystem-nomatch= --attr-match= --attr-nomatch= --property-match= --tag-match= --sysname-match= --parent-match=' ;; 'settle') comps='--help --timeout= --seq-start= --seq-end= --exit-if-exists= --quiet' ;; 'control') comps='--help --exit --log-priority= --stop-exec-queue --start-exec-queue --reload --property= --children-max= --timeout=' ;; 'monitor') comps='--help --kernel --udev --property --subsystem-match= --tag-match=' ;; 'hwdb') comps='--help --update --test=' ;; 'test') if [[ $cur = -* ]]; then comps='--help --action=' else comps=$( __get_all_sysdevs ) fi ;; 'test-builtin') comps='blkid btrfs hwdb input_id keyboard kmod net_id net_setup_link path_id usb_id uaccess' ;; *) comps=${VERBS[*]} ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 } complete -F _udevadm udevadm completions/fsfreeze000064400000001014152525375750010650 0ustar00_fsfreeze_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--freeze --unfreeze --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local MPOINT MPOINT="$(findmnt -t ext2,ext3,ext4,reiserfs,jfs,xfs -o TARGET -n -r)" COMPREPLY=( $(compgen -W "$MPOINT" -- $cur) ) return 0 } complete -F _fsfreeze_module fsfreeze completions/mkswap000064400000001511152525375750010343 0ustar00_mkswap_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-p'|'--pagesize') COMPREPLY=( $(compgen -W "bytes" -- $cur) ) return 0 ;; '-L'|'--label') COMPREPLY=( $(compgen -W "label" -- $cur) ) return 0 ;; '-v'|'--swapversion') COMPREPLY=( $(compgen -W "1" -- $cur) ) return 0 ;; '-U'|'--uuid') COMPREPLY=( $(compgen -W "$(uuidgen -r)" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--check --force --pagesize --label --swapversion --uuid --version --help" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _mkswap_module mkswap completions/fincore000064400000001624152525375750010473 0ustar00_fincore_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-o'|'--output') local prefix realcur OUTPUT_ALL OUTPUT realcur="${cur##*,}" prefix="${cur%$realcur}" OUTPUT_ALL='PAGES SIZE FILE RES' for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- "$realcur") ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS=" --json --bytes --noheadings --output --raw --help --version " COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- ${cur:-"/"}) ) return 0 } complete -F _fincore_module fincore completions/flock000064400000001552152525375750010144 0ustar00_flock_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-w'|'--timeout') COMPREPLY=( $(compgen -W "seconds" -- $cur) ) return 0 ;; '-E'|'--conflict-exit-code') COMPREPLY=( $(compgen -W "{0..255}" -- $cur) ) return 0 ;; '-c'|'--command') compopt -o bashdefault COMPREPLY=( $(compgen -c -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--shared --exclusive --unlock --nonblock --timeout --conflict-exit-code --close --command --no-fork --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- ${cur:-"/"}) ) return 0 } complete -F _flock_module flock completions/rev000064400000000660152525375750007641 0ustar00_rev_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--version --help" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _rev_module rev completions/blockdev000064400000001326152525375750010636 0ustar00_blockdev_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" DEVS="$(lsblk -pnro name)" OPTS="-h -V -q --report --getsz --setro --setrw --getro --getdiscardzeroes --getss --getpbsz --getiomin --getioopt --getalignoff --getmaxsect --getbsz --setbsz --getsize64 --setra --getra --setfra --getfra --flushbufs --rereadpt $DEVS" case $prev in '--setbsz') COMPREPLY=( $(compgen -W "bytes" -- $cur) ) return 0 ;; '--setbsz'|'--setfra') COMPREPLY=( $(compgen -W "sectors" -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 } complete -F _blockdev_module blockdev completions/p11-kit000064400000001010152525375750010221 0ustar00# p11-kit(8) completion -*- shell-script -*- _p11-kit() { local cur prev words cword _init_completion || return if [[ $cur == -* ]]; then local opts="--help --verbose -q --quiet" COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) return elif [[ $cword -eq 1 ]]; then local commands='list-modules extract server remote' COMPREPLY=( $(compgen -W "$commands" -- "$cur") ) fi } && complete -F _p11-kit p11-kit # ex: filetype=sh completions/wipefs000064400000002250152525375750010337 0ustar00_wipefs_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-O'|'--output') local prefix realcur OUTPUT_ALL OUTPUT realcur="${cur##*,}" prefix="${cur%$realcur}" OUTPUT_ALL="UUID LABEL LENGTH TYPE OFFSET USAGE DEVICE" for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) ) return 0 ;; '-o'|'--offset') COMPREPLY=( $(compgen -W "offset" -- $cur) ) return 0 ;; '-t'|'--types') local TYPES TYPES="$(blkid -k)" COMPREPLY=( $(compgen -W "$TYPES" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS=" --all --backup --force --noheadings --json --no-act --offset --output --parsable --quiet --types --help --version " COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) ) return 0 } complete -F _wipefs_module wipefs completions/systemd-path000064400000003555152525375750011475 0ustar00# systemd-path(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . __contains_word () { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done return 1 } __get_names() { systemd-path | { while IFS=: read -r a b; do echo " $a"; done; } } _systemd_path() { local comps local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local -A OPTS=( [STANDALONE]='-h --help --version' [ARG]='--suffix' ) _init_completion || return if __contains_word "$prev" ${OPTS[ARG]}; then case $prev in --suffix) comps='' ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 fi if [[ "$cur" = -* ]]; then COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) return 0 fi comps=$( __get_names ) COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 } complete -F _systemd_path systemd-path completions/ipcmk000064400000001100152525375750010136 0ustar00_ipcmk_module() { local cur prev COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-M'|'--shmem') COMPREPLY=( $(compgen -W "size" -- $cur) ) return 0 ;; '-S'|'--semaphore') COMPREPLY=( $(compgen -W "number" -- $cur) ) return 0 ;; '-p'|'--mode') COMPREPLY=( $(compgen -W "mode" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac COMPREPLY=( $(compgen -W "--shmem --semaphore --queue --mode --help --version" -- $cur) ) return 0 } complete -F _ipcmk_module ipcmk completions/setarch000064400000001426152525375750010477 0ustar00_setarch_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-h'|'--help'|'-V'|'--version') return 0 ;; esac if [ $COMP_CWORD -eq 1 ]; then COMPREPLY=( $(compgen -W "$($1 --list)" -- $cur) ) return 0 fi case $cur in -*) OPTS=" --32bit --fdpic-funcptrs --short-inode --addr-compat-layout --addr-no-randomize --whole-seconds --sticky-timeouts --read-implies-exec --mmap-page-zero --3gb --4gb --uname-2.6 --verbose --list --help --version " COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac compopt -o bashdefault COMPREPLY=( $(compgen -c -- $cur) ) return 0 } complete -F _setarch_module setarch completions/fstrim000064400000001245152525375750010351 0ustar00_fstrim_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-o'|'--offset'|'-l'|'--length'|'-m'|'--minimum') COMPREPLY=( $(compgen -W "num" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--all --offset --length --minimum --verbose --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local MPOINTS MPOINTS=$(findmnt -rno SOURCE,TARGET | awk '/^\/dev/{print $2}') COMPREPLY=( $(compgen -W "$MPOINTS" -- $cur) ) return 0 } complete -F _fstrim_module fstrim completions/lscpu000064400000001772152525375750010200 0ustar00_lscpu_module() { local cur OPTS_ALL COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '--extended='|'=') local prefix realcur OPTS cur=${cur#=} realcur="${cur##*,}" prefix="${cur%$realcur}" OPTS_ALL="CPU CORE SOCKET NODE BOOK DRAWER CACHE POLARIZATION ADDRESS CONFIGURED ONLINE MAXMHZ MINMHZ" for WORD in $OPTS_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then OPTS="$WORD $OPTS" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$OPTS" -S ',' -- $realcur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS_ALL="--all --online --offline --json --extended= --parse= --sysroot --hex --physical --help --version" COMPREPLY=( $(compgen -W "${OPTS_ALL[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _lscpu_module lscpu completions/fallocate000064400000001321152525375750010772 0ustar00_fallocate_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-o'|'--offset'|'-l'|'--length') COMPREPLY=( $(compgen -W "bytes" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS=" --collapse-range --dig-holes --insert-range --length --keep-size --offset --punch-hole --zero-range --posix --verbose --help --version " COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _fallocate_module fallocate completions/systemd-run000064400000011405152525375750011336 0ustar00# systemd-run(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . __systemctl() { local mode=$1; shift 1 systemctl $mode --full --no-legend "$@" } __get_slice_units () { __systemctl $1 list-units --all -t slice \ | { while read -r a b c d; do echo " $a"; done; }; } __get_machines() { local a b machinectl list --no-legend --no-pager | { while read a b; do echo " $a"; done; }; } _systemd_run() { local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local OPTS='-h --help --version --user --system --scope --unit --description --slice -r --remain-after-exit --send-sighup -H --host -M --machine --service-type --on-active --on-boot --on-startup --on-unit-active --on-unit-inactive --on-calendar --timer-property --path-property --socket-property -t --pty -q --quiet --no-block --uid --gid --nice -E --setenv -p --property --no-ask-password --wait -P --pipe -G --collect' local mode=--system local i local opts_with_values=( --unit --description --slice --service-type -H --host -M --machine -p --property --on-active --on-boot --on-startup --on-unit-active --on-unit-inactive --on-calendar --timer-property --path-property --socket-property --uid --gid --nice -E --setenv ) for (( i=1; i <= COMP_CWORD; i++ )); do if [[ ${COMP_WORDS[i]} != -* ]]; then local root_command=${COMP_WORDS[i]} _command_offset $i return fi [[ ${COMP_WORDS[i]} == "--user" ]] && mode=--user [[ $i -lt $COMP_CWORD && " ${opts_with_values[@]} " =~ " ${COMP_WORDS[i]} " ]] && ((i++)) done case "$prev" in --unit|--description|--on-active|--on-boot|--on-startup|--on-unit-active|--on-unit-inactive|--on-calendar) # argument required but no completions available return ;; --slice) local comps=$(__get_slice_units $mode) COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 ;; --service-type) local comps='simple forking oneshot dbus notify idle' COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 ;; -p|--property) local comps='CPUAccounting= MemoryAccounting= BlockIOAccounting= SendSIGHUP= SendSIGKILL= MemoryLimit= CPUShares= BlockIOWeight= User= Group= DevicePolicy= KillMode= DeviceAllow= BlockIOReadBandwidth= BlockIOWriteBandwidth= BlockIODeviceWeight= Nice= Environment= KillSignal= LimitCPU= LimitFSIZE= LimitDATA= LimitSTACK= LimitCORE= LimitRSS= LimitNOFILE= LimitAS= LimitNPROC= LimitMEMLOCK= LimitLOCKS= LimitSIGPENDING= LimitMSGQUEUE= LimitNICE= LimitRTPRIO= LimitRTTIME= PrivateTmp= PrivateDevices= PrivateNetwork= NoNewPrivileges= WorkingDirectory= RootDirectory= TTYPath= SyslogIdentifier= SyslogLevelPrefix= SyslogLevel= SyslogFacility= TimerSlackNSec= OOMScoreAdjust= ReadWritePaths= ReadOnlyPaths= InaccessiblePaths= EnvironmentFile= ProtectSystem= ProtectHome= RuntimeDirectory= PassEnvironment=' COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 ;; -H|--host) local comps=$(compgen -A hostname) COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 ;; -M|--machine) local comps=$( __get_machines ) COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 ;; --timer-property) local comps='AccuracySec= WakeSystem=' COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 ;; esac COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) return 0 } complete -F _systemd_run systemd-run completions/colrm000064400000000775152525375750010170 0ustar00_colrm_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--version --help" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac case $COMP_CWORD in 1) COMPREPLY=( $(compgen -W "startcol" -- $cur) ) ;; 2) COMPREPLY=( $(compgen -W "endcol" -- $cur) ) ;; esac return 0 } complete -F _colrm_module colrm completions/tuned-adm000064400000001134152525375750010720 0ustar00# bash completion for tuned-adm _tuned_adm() { local commands="active list off profile recommend verify --version -v --help -h auto_profile profile_mode profile_info" local cur prev words cword _init_completion || return if [[ "$cword" -eq 1 ]]; then COMPREPLY=( $(compgen -W "$commands" -- "$cur" ) ) elif [[ "$cword" -eq 2 && ("$prev" == "profile" || "$prev" == "profile_info") ]]; then COMPREPLY=( $(compgen -W "$(command find /usr/lib/tuned /etc/tuned -mindepth 1 -maxdepth 1 -type d -printf "%f\n")" -- "$cur" ) ) else COMPREPLY=() fi return 0 } && complete -F _tuned_adm tuned-adm completions/systemd-analyze000064400000015204152525375750012176 0ustar00# systemd-analyze(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # Copyright © 2010 Ran Benita # Copyright © 2013 Harald Hoyer # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . __contains_word () { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done } __get_machines() { local a b machinectl list --no-legend --no-pager | { while read a b; do echo " $a"; done; }; } __get_services() { systemctl list-units --no-legend --no-pager -t service --all $1 | \ { while read -r a b c; do [[ $b == "loaded" ]]; echo " $a"; done } } _systemd_analyze() { local i verb comps mode local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local -A OPTS=( [STANDALONE]='-h --help --version --system --user --global --order --require --no-pager --man=no --generators=yes' [ARG]='-H --host -M --machine --fuzz --from-pattern --to-pattern --root' ) local -A VERBS=( [STANDALONE]='time blame plot dump unit-paths calendar' [CRITICAL_CHAIN]='critical-chain' [DOT]='dot' [LOG_LEVEL]='log-level' [LOG_TARGET]='log-target' [VERIFY]='verify' [SECCOMP_FILTER]='syscall-filter' [SERVICE_WATCHDOGS]='service-watchdogs' [CAT_CONFIG]='cat-config' [SECURITY]='security' ) local CONFIGS='systemd/bootchart.conf systemd/coredump.conf systemd/journald.conf systemd/journal-remote.conf systemd/journal-upload.conf systemd/logind.conf systemd/resolved.conf systemd/networkd.conf systemd/resolved.conf systemd/sleep.conf systemd/system.conf systemd/timedated.conf systemd/timesyncd.conf systemd/user.conf udev/udev.conf' _init_completion || return for ((i=0; i < COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]} && ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then verb=${COMP_WORDS[i]} break fi done if __contains_word "$prev" ${OPTS[ARG]}; then case $prev in --host|-H) comps=$(compgen -A hostname) ;; --machine|-M) comps=$( __get_machines ) ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 fi if [[ -z $verb && $cur = -* ]]; then COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) return 0 fi if [[ -z $verb ]]; then comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[STANDALONE]}; then if [[ $cur = -* ]]; then comps='--help --version --system --user --global --no-pager' fi elif __contains_word "$verb" ${VERBS[CRITICAL_CHAIN]}; then if [[ $cur = -* ]]; then comps='--help --version --system --user --fuzz --no-pager' fi elif __contains_word "$verb" ${VERBS[DOT]}; then if [[ $cur = -* ]]; then comps='--help --version --system --user --global --from-pattern --to-pattern --order --require' fi elif __contains_word "$verb" ${VERBS[LOG_LEVEL]}; then if [[ $cur = -* ]]; then comps='--help --version --system --user' else comps='debug info notice warning err crit alert emerg' fi elif __contains_word "$verb" ${VERBS[LOG_TARGET]}; then if [[ $cur = -* ]]; then comps='--help --version --system --user' else comps='console journal kmsg journal-or-kmsg null' fi elif __contains_word "$verb" ${VERBS[SECCOMP_FILTER]}; then if [[ $cur = -* ]]; then comps='--help --version --no-pager' fi elif __contains_word "$verb" ${VERBS[VERIFY]}; then if [[ $cur = -* ]]; then comps='--help --version --system --user --global --man=no --generators=yes' else comps=$( compgen -A file -- "$cur" ) compopt -o filenames fi elif __contains_word "$verb" ${VERBS[SERVICE_WATCHDOGS]}; then if [[ $cur = -* ]]; then comps='--help --version --system --user' else comps='on off' fi elif __contains_word "$verb" ${VERBS[CAT_CONFIG]}; then if [[ $cur = -* ]]; then comps='--help --version --root --no-pager' elif [[ -z $cur ]]; then comps="$CONFIGS" compopt -o filenames else comps="$CONFIGS $( compgen -A file -- "$cur" )" compopt -o filenames fi elif __contains_word "$verb" ${VERBS[SECURITY]}; then if [[ $cur = -* ]]; then comps='--help --version --no-pager --system --user -H --host -M --machine' else if __contains_word "--user" ${COMP_WORDS[*]}; then mode=--user else mode=--system fi comps=$( __get_services $mode ) fi fi COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 } complete -F _systemd_analyze systemd-analyze completions/partx000064400000002341152525375750010201 0ustar00_partx_module() { local cur prev OPTS OUTPUT_ALL COMPREPLY=() OUTPUT_ALL="NR START END SECTORS SIZE NAME UUID TYPE FLAGS SCHEME" cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-n'|'--nr') return 0 ;; '-o'|'--output') local realcur prefix OUTPUT realcur="${cur##*,}" prefix="${cur%$realcur}" for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) ) return 0 ;; '-S'|'--sector-size') COMPREPLY=( $(compgen -W "size" -- $cur) ) return 0 ;; '-t'|'--type') COMPREPLY=( $(compgen -W "$(partx --list-types)" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS=" --add --delete --update --show --bytes --noheadings --nr --output --pairs --raw --sector-size --type --list-types --verbose --help --version " COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) ) return 0 } complete -F _partx_module partx completions/loginctl000064400000010233152525375750010655 0ustar00# loginctl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # Copyright © 2010 Ran Benita # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . __contains_word () { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done } __get_all_sessions () { loginctl --no-legend list-sessions | { while read -r a b; do printf "%s\n" "$a"; done; } ; } __get_all_users () { loginctl --no-legend list-users | { while read -r a b; do printf "%s\n" "$b"; done; } ; } __get_all_seats () { loginctl --no-legend list-seats | { while read -r a b; do printf "%s\n" "$a"; done; } ; } _loginctl () { local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local i verb comps local -A OPTS=( [STANDALONE]='--all -a --help -h --no-pager --version --no-legend --no-ask-password -l --full --value' [ARG]='--host -H --kill-who --property -p --signal -s -M --machine -n --lines -o --output' ) if __contains_word "$prev" ${OPTS[ARG]}; then case $prev in --signal|-s) _signals return ;; --kill-who) comps='all leader' ;; --host|-H) comps=$(compgen -A hostname) ;; --property|-p) comps='' ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 fi if [[ "$cur" = -* ]]; then COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) return 0 fi local -A VERBS=( [SESSIONS]='session-status show-session activate lock-session unlock-session terminate-session kill-session' [USERS]='user-status show-user enable-linger disable-linger terminate-user kill-user' [SEATS]='seat-status show-seat terminate-seat' [STANDALONE]='list-sessions lock-sessions unlock-sessions list-users list-seats flush-devices' [ATTACH]='attach' ) for ((i=0; i < COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]} && ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then verb=${COMP_WORDS[i]} break fi done if [[ -z $verb ]]; then comps="${VERBS[*]}" elif __contains_word "$verb" ${VERBS[SESSIONS]}; then comps=$( __get_all_sessions ) elif __contains_word "$verb" ${VERBS[USERS]}; then comps=$( __get_all_users ) elif __contains_word "$verb" ${VERBS[SEATS]}; then comps=$( __get_all_seats ) elif __contains_word "$verb" ${VERBS[STANDALONE]}; then comps='' elif __contains_word "$verb" ${VERBS[ATTACH]}; then if [[ $prev = $verb ]]; then comps=$( __get_all_seats ) else comps=$(compgen -A file -- "$cur" ) compopt -o filenames fi fi COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 } complete -F _loginctl loginctl completions/blkdiscard000064400000001177152525375750011153 0ustar00_blkdiscard_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-o'|'--offset'|'-l'|'--length'|'-p'|'--step') COMPREPLY=( $(compgen -W "num" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS=" --offset --length --step --secure --zeroout --verbose --help --version " COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) ) return 0 } complete -F _blkdiscard_module blkdiscard completions/cal000064400000000652152525375750007605 0ustar00_cal_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" case $cur in -*) OPTS=" --one --three --months --sunday --span --monday --julian --year --twelve --week --color=auto --color=always --color=never --version --help" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac return 0 } complete -F _cal_module cal completions/col000064400000000714152525375750007622 0ustar00_col_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-l'|'--lines') COMPREPLY=( $(compgen -W "number" -- $cur) ) return 0 ;; '-H'|'--help'|'-V'|'--version') return 0 ;; esac OPTS="--no-backspaces --fine --pass --tabs --spaces --lines --version --help" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 } complete -F _col_module col completions/swapoff000064400000001347152525375750010515 0ustar00_swapoff_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-a'|'--all') return 0 ;; '-U'|'UUID=') COMPREPLY=( $(compgen -W "$(swapon --show=UUID --noheading)" -- $cur) ) return 0 ;; '-L'|'LABEL=') COMPREPLY=( $(compgen -W "$(swapon --show=LABEL --noheading)" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="-L -U --all --verbose --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -W "$(swapon --show=NAME --raw --noheading)" -- $cur) ) return 0 } complete -F _swapoff_module swapoff completions/fdisk000064400000003452152525375750010147 0ustar00_fdisk_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-s'|'--getsz') COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) ) return 0 ;; '-b'|'--sector-size') COMPREPLY=( $(compgen -W "512 1024 2048 4096" -- $cur) ) return 0 ;; '-c'|'--compatibility') COMPREPLY=( $(compgen -W "dos nondos" -- $cur) ) return 0 ;; '-L'|'--color') COMPREPLY=( $(compgen -W "auto never always" -- $cur) ) return 0 ;; '--output') local prefix realcur OUTPUT_ALL OUTPUT realcur="${cur##*,}" prefix="${cur%$realcur}" OUTPUT_ALL=" Attrs Boot Bsize Cpg Cylinders Device End End-C/H/S Flags Fsize Id Name Sectors Size Slice Start Start-C/H/S Type Type-UUID UUID " for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- "$realcur") ) return 0 ;; '-u'|'--units') COMPREPLY=( $(compgen -W "cylinders sectors" -- $cur) ) return 0 ;; '-C'|'--cylinders'|'-H'|'--heads'|'-S'|'--sectors') COMPREPLY=( $(compgen -W "number" -- $cur) ) return 0 ;; '-h'|'--help'|'-v'|'--version'|'-V'|'--list') return 0 ;; esac case $cur in -*) OPTS="--sector-size --protect-boot --compatibility --color --list --output --type --units --getsz --bytes --wipe --wipe-partitions --cylinders --heads --sectors --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) ) return 0 } complete -F _fdisk_module fdisk completions/systemctl000064400000032407152525375750011100 0ustar00# systemctl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # Copyright © 2010 Ran Benita __systemctl() { local mode=$1; shift 1 systemctl $mode --full --no-legend --no-pager "$@" 2>/dev/null } __systemd_properties() { /usr/lib/systemd/systemd --dump-bus-properties } __contains_word () { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done } __filter_units_by_property () { local mode=$1 property=$2 value=$3 ; shift 3 local units=("$@") local props i IFS=$'\n' read -rd '' -a props < \ <(__systemctl $mode show --property "$property" -- "${units[@]}") for ((i=0; $i < ${#units[*]}; i++)); do if [[ "${props[i]}" = "$property=$value" ]]; then echo " ${units[i]}" fi done } __filter_units_by_properties () { local mode=$1 properties=$2 values=$3 ; shift 3 local units=("$@") local props i j conditions=() IFS=$'\n' read -rd '' -a props < \ <(__systemctl $mode show --property "$properties" -- "${units[@]}") IFS=$',' read -r -a properties < <(echo $properties) IFS=$',' read -r -a values < <(echo $values) for ((i=0; i < ${#properties[*]}; i++)); do for ((j=0; j < ${#properties[*]}; j++)); do if [[ ${props[i]%%=*} == ${properties[j]} ]]; then conditions+=( "${properties[j]}=${values[j]}" ) fi done done for ((i=0; i < ${#units[*]}; i++)); do for ((j=0; j < ${#conditions[*]}; j++)); do if [[ "${props[i * ${#conditions[*]} + j]}" != "${conditions[j]}" ]]; then break fi done if (( j == ${#conditions[*]} )); then echo " ${units[i]}" fi done } __get_all_units () { { __systemctl $1 list-unit-files "$2*"; __systemctl $1 list-units --all "$2*"; } \ | { while read -r a b; do echo " $a"; done; }; } __get_non_template_units() { { __systemctl $1 list-unit-files "$2*"; __systemctl $1 list-units --all "$2*"; } \ | { while read -r a b; do [[ $a =~ @\. ]] || echo " $a"; done; }; } __get_template_names () { __systemctl $1 list-unit-files "$2*" \ | { while read -r a b; do [[ $a =~ @\. ]] && echo " ${a%%@.*}@"; done; }; } __get_active_units () { __systemctl $1 list-units "$2*" \ | { while read -r a b; do echo " $a"; done; }; } __get_startable_units () { # find startable inactive units __filter_units_by_properties $1 ActiveState,CanStart inactive,yes $( { __systemctl $1 list-unit-files --state enabled,enabled-runtime,linked,linked-runtime,static,indirect,disabled,generated,transient "$2*" | \ { while read -r a b; do [[ $a =~ @\. ]] || echo " $a"; done; } __systemctl $1 list-units --state inactive,failed "$2*" | \ { while read -r a b c; do [[ $b == "loaded" ]] && echo " $a"; done; } } | sort -u ) } __get_restartable_units () { # filter out masked and not-found __filter_units_by_property $1 CanStart yes $( __systemctl $1 list-unit-files --state enabled,disabled,static "$2*" | \ { while read -r a b; do [[ $a =~ @\. ]] || echo " $a"; done; } __systemctl $1 list-units "$2*" | \ { while read -r a b; do echo " $a"; done; } ) } __get_failed_units () { __systemctl $1 list-units "$2*" \ | { while read -r a b c d; do [[ $c == "failed" ]] && echo " $a"; done; }; } __get_enabled_units () { __systemctl $1 list-unit-files "$2*" \ | { while read -r a b c ; do [[ $b == "enabled" ]] && echo " $a"; done; }; } __get_disabled_units () { __systemctl $1 list-unit-files "$2*" \ | { while read -r a b c ; do [[ $b == "disabled" ]] && echo " $a"; done; }; } __get_masked_units () { __systemctl $1 list-unit-files "$2*" \ | { while read -r a b c ; do [[ $b == "masked" ]] && echo " $a"; done; }; } __get_all_unit_files () { { __systemctl $1 list-unit-files "$2*"; } | { while read -r a b; do echo " $a"; done; }; } __get_machines() { local a b { machinectl list-images --no-legend --no-pager; machinectl list --no-legend --no-pager; } | \ { while read a b; do echo " $a"; done; } } _systemctl () { local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local i verb comps mode local -A OPTS=( [STANDALONE]='--all -a --reverse --after --before --defaults --force -f --full -l --global --help -h --no-ask-password --no-block --no-legend --no-pager --no-reload --no-wall --now --quiet -q --system --user --version --runtime --recursive -r --firmware-setup --show-types --plain --failed --value --fail --dry-run --wait' [ARG]='--host -H --kill-who --property -p --signal -s --type -t --state --job-mode --root --preset-mode -n --lines -o --output -M --machine --message --check-inhibitors' ) if __contains_word "--user" ${COMP_WORDS[*]}; then mode=--user elif __contains_word "--global" ${COMP_WORDS[*]}; then mode=--user else mode=--system fi if __contains_word "$prev" ${OPTS[ARG]}; then case $prev in --signal|-s) _signals return ;; --type|-t) comps=$(__systemctl $mode -t help) ;; --state) comps=$(__systemctl $mode --state=help) ;; --job-mode) comps='fail replace replace-irreversibly isolate ignore-dependencies ignore-requirements flush' ;; --kill-who) comps='all control main' ;; --root) comps=$(compgen -A directory -- "$cur" ) compopt -o filenames ;; --host|-H) comps=$(compgen -A hostname) ;; --property|-p) comps=$(__systemd_properties) ;; --preset-mode) comps='full enable-only disable-only' ;; --output|-o) comps='short short-full short-iso short-iso-precise short-precise short-monotonic short-unix verbose export json json-pretty json-sse cat' ;; --machine|-M) comps=$( __get_machines ) ;; --check-inhibitors) comps='auto yes no' ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 fi if [[ "$cur" = -* ]]; then COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) return 0 fi local -A VERBS=( [ALL_UNITS]='cat mask' [NONTEMPLATE_UNITS]='is-active is-failed is-enabled status show preset help list-dependencies edit set-property revert' [ENABLED_UNITS]='disable' [DISABLED_UNITS]='enable' [REENABLABLE_UNITS]='reenable' [FAILED_UNITS]='reset-failed' [STARTABLE_UNITS]='start' [STOPPABLE_UNITS]='stop condstop kill try-restart condrestart' [ISOLATABLE_UNITS]='isolate' [RELOADABLE_UNITS]='reload condreload try-reload-or-restart force-reload' [RESTARTABLE_UNITS]='restart reload-or-restart' [TARGET_AND_UNITS]='add-wants add-requires' [MASKED_UNITS]='unmask' [JOBS]='cancel' [ENVS]='set-environment unset-environment import-environment' [STANDALONE]='daemon-reexec daemon-reload default emergency exit halt hibernate hybrid-sleep suspend-then-hibernate kexec list-jobs list-sockets list-timers list-units list-unit-files poweroff reboot rescue show-environment suspend get-default is-system-running preset-all' [FILE]='link switch-root' [TARGETS]='set-default' [MACHINES]='list-machines' ) for ((i=0; i < COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]} && ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then verb=${COMP_WORDS[i]} break fi done if [[ -z $verb ]]; then comps="${VERBS[*]}" elif __contains_word "$verb" ${VERBS[ALL_UNITS]}; then comps=$( __get_all_units $mode "$cur" ) compopt -o filenames elif __contains_word "$verb" ${VERBS[NONTEMPLATE_UNITS]}; then comps=$( __get_non_template_units $mode "$cur" ) compopt -o filenames elif __contains_word "$verb" ${VERBS[ENABLED_UNITS]}; then comps=$( __get_enabled_units $mode "$cur" ) compopt -o filenames elif __contains_word "$verb" ${VERBS[DISABLED_UNITS]}; then comps=$( __get_disabled_units $mode "$cur"; __get_template_names $mode "$cur") compopt -o filenames elif __contains_word "$verb" ${VERBS[REENABLABLE_UNITS]}; then comps=$( __get_disabled_units $mode "$cur"; __get_enabled_units $mode "$cur"; __get_template_names $mode "$cur") compopt -o filenames elif __contains_word "$verb" ${VERBS[STARTABLE_UNITS]}; then comps=$( __get_startable_units $mode "$cur" ) compopt -o filenames elif __contains_word "$verb" ${VERBS[RESTARTABLE_UNITS]}; then comps=$( __get_restartable_units $mode "$cur" ) compopt -o filenames elif __contains_word "$verb" ${VERBS[STOPPABLE_UNITS]}; then comps=$( __filter_units_by_property $mode CanStop yes \ $( __get_active_units $mode "$cur" ) ) compopt -o filenames elif __contains_word "$verb" ${VERBS[RELOADABLE_UNITS]}; then comps=$( __filter_units_by_property $mode CanReload yes \ $( __get_active_units $mode "$cur" ) ) compopt -o filenames elif __contains_word "$verb" ${VERBS[ISOLATABLE_UNITS]}; then comps=$( __filter_units_by_property $mode AllowIsolate yes \ $( __get_all_units $mode "$cur" ) ) compopt -o filenames elif __contains_word "$verb" ${VERBS[FAILED_UNITS]}; then comps=$( __get_failed_units $mode "$cur" ) compopt -o filenames elif __contains_word "$verb" ${VERBS[MASKED_UNITS]}; then comps=$( __get_masked_units $mode "$cur" ) compopt -o filenames elif __contains_word "$verb" ${VERBS[TARGET_AND_UNITS]}; then if __contains_word "$prev" ${VERBS[TARGET_AND_UNITS]} \ || __contains_word "$prev" ${OPTS[STANDALONE]}; then comps=$( __systemctl $mode list-unit-files --type target --all "$cur*" \ | { while read -r a b; do echo " $a"; done; } ) else comps=$( __get_all_unit_files $mode "$cur" ) fi compopt -o filenames elif __contains_word "$verb" ${VERBS[STANDALONE]}; then comps='' elif __contains_word "$verb" ${VERBS[JOBS]}; then comps=$( __systemctl $mode list-jobs | { while read -r a b; do echo " $a"; done; } ) elif __contains_word "$verb" ${VERBS[ENVS]}; then comps=$( __systemctl $mode show-environment \ | while read -r line; do echo " ${line%%=*}="; done ) compopt -o nospace elif __contains_word "$verb" ${VERBS[FILE]}; then comps=$( compgen -A file -- "$cur" ) compopt -o filenames elif __contains_word "$verb" ${VERBS[TARGETS]}; then comps=$( __systemctl $mode list-unit-files --type target --full --all "$cur*" \ | { while read -r a b; do echo " $a"; done; } ) fi COMPREPLY=( $(compgen -o filenames -W '$comps' -- "$cur") ) return 0 } complete -F _systemctl systemctl completions/fsck000064400000001423152525375750007771 0ustar00_fsck_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-b') COMPREPLY=( $(compgen -W "superblock" -- $cur) ) return 0 ;; '-B') COMPREPLY=( $(compgen -W "blocksize" -- $cur) ) return 0 ;; '-j') COMPREPLY=( $(compgen -W "external_journal" -- $cur) ) return 0 ;; '-l'|'-L') COMPREPLY=( $(compgen -W "bad_blocks_file" -- $cur) ) return 0 ;; '-?') return 0 ;; esac case $cur in -*) OPTS="-p -n -y -c -f -v -b -B -j -l -L" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -W "$(find -L /dev/ -path /dev/fd -prune \ -o -type b -print 2>/dev/null)" -- $cur) ) return 0 } complete -F _fsck_module fsck completions/renice000064400000001420152525375750010305 0ustar00_renice_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-g'|'--pgrp') local PGRP PGRP=$(ps -ax -opgrp | sed '1d') COMPREPLY=( $(compgen -W "$PGRP" -- $cur) ) return 0 ;; '-n'|'--priority') COMPREPLY=( $(compgen -W "{-20..20}" -- $cur) ) return 0 ;; '-p'|'--pid') local PIDS PIDS=$(cd /proc && echo [0-9]*) COMPREPLY=( $(compgen -W "$PIDS" -- $cur) ) return 0 ;; '-u'|'--user') COMPREPLY=( $(compgen -u -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac OPTS="--pgrp --priority --pid --user --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 } complete -F _renice_module renice completions/fsck.cramfs000064400000001254152525375750011245 0ustar00_fsck.cramfs_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-b'|'--blocksize') COMPREPLY=( $(compgen -W "size" -- $cur) ) return 0 ;; '--extract') local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -o dirnames -- ${cur:-"/"}) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) COMPREPLY=( $(compgen -W "--verbose --blocksize --extract --help --version" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _fsck.cramfs_module fsck.cramfs completions/ctrlaltdel000064400000000517152525375750011200 0ustar00_ctrlaltdel_module() { local cur prev COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-h'|'--help'|'-V'|'--version') return 0 ;; esac if [ $COMP_CWORD -eq 1 ]; then COMPREPLY=( $(compgen -W "hard soft" -- $cur) ) fi return 0 } complete -F _ctrlaltdel_module ctrlaltdel completions/scriptreplay000064400000001161152525375750011563 0ustar00_scriptreplay_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-d'|'--divisor'|'-m'|'--maxdelay') COMPREPLY=( $(compgen -W "digit" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--timing --typescript --divisor --maxdelay --version --help" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _scriptreplay_module scriptreplay completions/systemd-cat000064400000003567152525375750011313 0ustar00# systemd-cat(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . __contains_word() { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done } _systemd_cat() { local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local i verb comps local -A OPTS=( [STANDALONE]='-h --help --version' [ARG]='-t --identifier -p --priority --level-prefix' ) _init_completion || return if __contains_word "$prev" ${OPTS[ARG]}; then case $prev in --identifier|-t) comps='' ;; --priority|-p) comps='emerg alert crit err warning notice info debug' ;; --level-prefix) comps='yes no' ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 fi COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) } complete -F _systemd_cat systemd-cat completions/unshare000064400000001451152525375750010511 0ustar00_unshare_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '--propagation') COMPREPLY=( $(compgen -W "slave shared private unchanged" -- $cur) ) return 0 ;; '-s'|'--setgroups') COMPREPLY=( $(compgen -W "allow deny" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--mount --uts --ipc --net --pid --user --cgroup --fork --kill-child --mount-proc --map-root-user --propagation --setgroups --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac compopt -o bashdefault COMPREPLY=( $(compgen -c -- $cur) ) return 0 } complete -F _unshare_module unshare completions/colcrt000064400000000744152525375750010336 0ustar00_colcrt_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS=" --no-underlining --half-lines --version --help" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _colcrt_module colcrt completions/kmod000064400000006243152525375750010002 0ustar00# kmod completion -*- shell-script -*- # # This file is part of kmod. # # Copyright 2010 Ran Benita # Copyright (C) 2013 Intel Corporation. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with this program; if not, see . __contains_word () { local word=$1; shift for w in "$@"; do [[ "$w" = "$word" ]] && return 0; done return 1 } __is_opt () { local prevprev=${COMP_WORDS[COMP_CWORD-2]} local short="$1" long="$2" if [[ "$prev" = "$short" || "$prev" = "$long" ]]; then declare -g cur=${cur#=} return 0 elif [[ "$prev" = "=" && "$prevprev" = "$long" ]]; then return 0 fi return 1 } _kmod_static_nodes () { local OPTS='-o -f -h --help' local OPTS_EQUAL='--output --format' local GROUP_FORMAT='human tmpfiles devname' if __is_opt '-o' '--output'; then compopt -o filenames COMPREPLY=( $(compgen -f -- "$cur") ) return 0 elif __is_opt '-f' '--format'; then COMPREPLY=( $(compgen -W "$GROUP_FORMAT" -- "$cur" ) ) return 0 fi local cur=${COMP_WORDS[COMP_CWORD]} compopt -o nospace COMPREPLY=( $(compgen -W "$OPTS" -- "$cur") ) COMPREPLY+=( $(compgen -W "$OPTS_EQUAL" -S= -- "$cur") ) } _kmod() { local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local VERBS=(help list static-nodes) local OPTS='-h --help -V --version' local verb # standalone options, no other option or action allowed for ((i=0; $i < $COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" ${OPTS}; then return 0 fi done # find the action for ((i=0; $i <= $COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" "${VERBS[@]}"; then verb=${COMP_WORDS[i]} break fi done if [[ -z $verb ]]; then COMPREPLY=( $(compgen -W '${OPTS[*]} ${VERBS[*]}' -- "$cur") ) return 0 fi local func=${verb//-/_} if declare -F _kmod_${func} > /dev/null; then _kmod_${func} fi # allow the space if there's only one completion and it doesn't end with # '=' if [[ ${#COMPREPLY[@]} == 1 && ${COMPREPLY[0]} != *"=" ]] ; then compopt +o nospace fi return 0 } complete -F _kmod kmod completions/rtcwake000064400000002071152525375750010503 0ustar00_rtcwake_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-A'|'--adjfile') local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 ;; '-d'|'--device') local RTC_DEVS RTC_DEVS=$(cd /sys/class/rtc/ && echo *) COMPREPLY=( $(compgen -W "$RTC_DEVS" -- $cur) ) return 0 ;; '-m'|'--mode') COMPREPLY=( $(compgen -W "$(rtcwake --list-modes)" -- $cur) ) return 0 ;; '-s'|'--seconds') COMPREPLY=( $(compgen -W "seconds" -- $cur) ) return 0 ;; '-t'|'--time') COMPREPLY=( $(compgen -W "time_t" -- $cur) ) return 0 ;; '--date') COMPREPLY=( $(compgen -W "YYYYMMDDhhmmss" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac OPTS=" --auto --adjfile --date --device --dry-run --local --list-modes --mode --seconds --time --utc --verbose --help --version " COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 } complete -F _rtcwake_module rtcwake completions/syspurpose000064400000001320152525375750011273 0ustar00# # syspurpose bash completion script # based on subscription-manager script # vim:ts=2:sw=2:et: # # Known and shared constants of syspurpose _syspurpose_help_opts="-h --help" # complete functions for subcommands ($1 - current opt, $2 - previous opt) # main complete function _syspurpose() { local first cur prev opts base COMPREPLY=() first=${COMP_WORDS[1]} cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" # top-level commands and options opts="set unset add remove set-role unset-role set-usage unset-usage unset-addons add-addons remove-addons set-sla unset-sla show -h --help" COMPREPLY=($(compgen -W "${opts}" -- ${cur})) return 0 } complete -F _syspurpose syspurpose completions/chfn000064400000000675152525375750007771 0ustar00_chfn_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-u'|'--help'|'-v'|'--version') return 0 ;; esac case $cur in -*) OPTS="--full-name --office --office-phone --home-phone --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -u -- $cur) ) return 0 } complete -F _chfn_module chfn completions/ipcrm000064400000002617152525375750010163 0ustar00_ipcrm_module() { local cur prev OPTS KEYIDS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-m'|'--shmem-id') KEYIDS="$(ipcs -m | awk '{if (3 < NR) {print $2}}')" COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) return 0 ;; '-M'|'--shmem-key') KEYIDS="$(ipcs -m | awk '{if (3 < NR) {print $1}}')" COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) return 0 ;; '-q'|'--queue-id') KEYIDS="$(ipcs -q | awk '{if (3 < NR) {print $2}}')" COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) return 0 ;; '-Q'|'--queue-key') KEYIDS="$(ipcs -q | awk '{if (3 < NR) {print $1}}')" COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) return 0 ;; '-s'|'--semaphore-id') KEYIDS="$(ipcs -s | awk '{if (3 < NR) {print $2}}')" COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) return 0 ;; '-S'|'--semaphore-key') KEYIDS="$(ipcs -s | awk '{if (3 < NR) {print $1}}')" COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in '=') cur=${cur#=} COMPREPLY=( $(compgen -W "shm msg sem" -- $cur) ) return 0 ;; esac OPTS=" --shmem-id --shmem-key --queue-id --queue-key --semaphore-id --semaphore-key --all= --verbose --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 } complete -F _ipcrm_module ipcrm completions/namei000064400000000764152525375750010143 0ustar00_namei_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--help --version --mountpoints --modes --owners --long --nosymlinks --vertical" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _namei_module namei completions/addpart000064400000000677152525375750010474 0ustar00_addpart_module() { local cur COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" case $COMP_CWORD in 1) OPTS="--help --version $(lsblk -pnro name)" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) ;; 2) # FIXME: how to determine next free partition number ;; 3) COMPREPLY=( $(compgen -W "start" -- $cur) ) ;; 4) COMPREPLY=( $(compgen -W "length" -- $cur) ) ;; esac return 0 } complete -F _addpart_module addpart completions/systemd-cgtop000064400000004060152525375750011645 0ustar00# systemd-cgtop(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . __contains_word() { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done } __get_machines() { local a b machinectl list --no-legend --no-pager | { while read a b; do echo " $a"; done; }; } _systemd_cgtop() { local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local comps local -A OPTS=( [STANDALONE]='-h --help --version -p -t -c -m -i -b --batch -r --raw -k -P' [ARG]='--cpu --depth -M --machine --recursive -n --iterations -d --delay --order' ) _init_completion || return if __contains_word "$prev" ${OPTS[ARG]}; then case $prev in --machine|-M) comps=$( __get_machines ) ;; --recursive) comps='yes no' ;; --order) comps='path tasks cpu memory io' ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 fi COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) } complete -F _systemd_cgtop systemd-cgtop completions/mkfs000064400000001176152525375750010010 0ustar00_mkfs_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-t'|'--type') FSTYPES=$(for I in /sbin/mkfs.* /usr/sbin/mkfs.*; do if [ -e $I ]; then echo ${I##*mkfs.}; fi; done) COMPREPLY=( $(compgen -W "$FSTYPES" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS='--type --verbose --help --version' COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -W "$(lsblk -pnro name) /path/to/file" -- $cur) ) return 0 } complete -F _mkfs_module mkfs completions/localectl000064400000007233152525375750011012 0ustar00# localectl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # Copyright © 2010 Ran Benita # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . __contains_word () { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done } __locale_fields=( LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME \ LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER \ LC_NAME LC_ADDRESS LC_TELEPHONE \ LC_MEASUREMENT LC_IDENTIFICATION ) # LC_ALL is omitted on purpose _localectl() { local i verb comps locale_vals local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local OPTS='-h --help --version --no-convert --no-pager --no-ask-password -H --host -M --machine' if __contains_word "$prev" $OPTS; then case $prev in --host|-H) comps='' ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 fi if [[ $cur = -* ]]; then COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) return 0 fi local -A VERBS=( [STANDALONE]='status list-locales list-keymaps list-x11-keymap-models list-x11-keymap-layouts list-x11-keymap-options' [VARIANTS]='list-x11-keymap-variants' [LOCALES]='set-locale' [KEYMAPS]='set-keymap' [X11]='set-x11-keymap' ) for ((i=0; i < COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]}; then verb=${COMP_WORDS[i]} break fi done if [[ -z $verb ]]; then comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[VARIANTS]}; then comps=$(command localectl list-x11-keymap-layouts) elif __contains_word "$verb" ${VERBS[LOCALES]}; then if [[ $cur = *=* ]]; then mapfile -t locale_vals < <(command localectl list-locales 2>/dev/null) COMPREPLY=( $(compgen -W '${locale_vals[*]}' -- "${cur#=}") ) elif [[ $prev = "=" ]]; then mapfile -t locale_vals < <(command localectl list-locales 2>/dev/null) COMPREPLY=( $(compgen -W '${locale_vals[*]}' -- "$cur") ) else compopt -o nospace COMPREPLY=( $(compgen -W '${__locale_fields[*]}' -S= -- "$cur") ) fi return 0 elif __contains_word "$verb" ${VERBS[KEYMAPS]}; then comps=$(command localectl list-keymaps) elif __contains_word "$verb" ${VERBS[STANDALONE]} ${VERBS[X11]}; then comps='' fi COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 } complete -F _localectl localectl completions/systemd-delta000064400000003637152525375750011633 0ustar00# systemd-delta(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . __contains_word() { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done } _systemd-delta() { local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local comps local -A OPTS=( [STANDALONE]='--help -h --no-pager --version' [ARG]='--diff --type -t' ) _init_completion || return if __contains_word "$prev" ${OPTS[ARG]}; then case $prev in --diff) comps='yes no' ;; --type|-t) comps='masked equivalent redirected overridden unchanged extended default' ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 fi if [[ "$cur" = -* ]]; then COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) return 0 fi COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 } complete -F _systemd-delta systemd-delta completions/dmesg000064400000002236152525375750010145 0ustar00 _dmesg_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-F'|'--file') local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 ;; '-f'|'--facility') COMPREPLY=( $(compgen -W "kern user mail daemon auth syslog lpr news" -- $cur) ) return 0 ;; '-l'|'--level'|'-n'|'--console-level') COMPREPLY=( $(compgen -W "emerg alert crit err warn notice info debug" -- $cur) ) return 0 ;; '-s'|'--buffer-size') COMPREPLY=( $(compgen -W "size" -- $cur) ) return 0 ;; '--time-format') COMPREPLY=( $(compgen -W "delta reltime ctime notime iso" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac OPTS="--clear --read-clear --console-off --show-delta --reltime --console-on --file --facility --human --kernel --color --level --console-level --nopager --raw --syslog --buffer-size --ctime --notime --time-format --userspace --follow --decode --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 } complete -F _dmesg_module dmesg completions/findfs000064400000001267152525375750010322 0ustar00_findfs_module() { local cur prev OPTS findable COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--version --help" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac for i in $(lsblk -rpno label); do findable+=" LABEL=$i" done for i in $(lsblk -rpno uuid); do findable+=" UUID=$i" done for i in $(lsblk -rpno partlabel); do findable+=" PARTLABEL=$i" done for i in $(lsblk -rpno partuuid); do findable+=" PARTUUID=$i" done COMPREPLY=( $(compgen -W "$findable" -- $cur) ) return 0 } complete -F _findfs_module findfs completions/lsinitrd000064400000003677152525375750010710 0ustar00# # Copyright 2013 Red Hat, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # __contains_word () { local word=$1; shift for w in $*; do [[ $w = $word ]] && return 0; done return 1 } _lsinitrd() { local field_vals= cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local -A OPTS=( [STANDALONE]='-s --size -h --help' [ARG]='-f --file -k --kver' ) if __contains_word "$prev" ${OPTS[ARG]}; then case $prev in --file|-f) comps=$(compgen -f -- "$cur") compopt -o filenames ;; --kver|-k) comps=$(cd /lib/modules; echo [0-9]*) ;; *) return 0 ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 fi if [[ $cur = -* ]]; then COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) return 0 fi comps=$(compgen -f -- "$cur") compopt -o filenames COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 } complete -F _lsinitrd lsinitrd completions/eject000064400000002245152525375750010140 0ustar00_eject_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-a'|'--auto'|'-i'|'--manualeject') COMPREPLY=( $(compgen -W "off on" -- $cur) ) return 0 ;; '-c'|'--changerslot') # FIXME: there must be way to determine slots COMPREPLY=( $(compgen -W "slot" -- $cur) ) return 0 ;; '-x'|'--cdspeed') COMPREPLY=( $(compgen -W "$($1 -X)" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--auto --changerslot --default --floppy --force --manualeject --no-unmount --no-partitions-unmount --noop --proc --tape --cdrom --scsi --trayclose --traytoggle --verbose --cdspeed --listspeed --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local DEVS DEVS="$(for I in /sys/class/block/*/removable; do if [ $(cat $I) -ne 0 ]; then OLD_IFS=$IFS IFS='/'; ARR=($I) echo "/dev/${ARR[4]}" IFS=$OLD_IFS fi done)" COMPREPLY=( $(compgen -W "$DEVS" $cur) ) return 0 } complete -F _eject_module eject completions/mesg000064400000000634152525375750010001 0ustar00_mesg_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--verbose --version --help" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -W "y n" -- $cur) ) return 0 } complete -F _mesg_module mesg completions/lsblk000064400000003651152525375750010157 0ustar00_lsblk_module() { local cur prev OPTS LSBLK_COLS_ALL COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" LSBLK_COLS_ALL=" NAME KNAME MAJ:MIN FSTYPE MOUNTPOINT LABEL UUID PARTTYPE PARTLABEL PARTUUID PARTFLAGS RA RO RM HOTPLUG MODEL SERIAL SIZE STATE OWNER GROUP MODE ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC ROTA SCHED RQ-SIZE TYPE DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO WSAME WWN RAND PKNAME HCTL TRAN SUBSYSTEMS REV VENDOR " case $prev in '-e'|'--exclude'|'-I'|'--include') local realcur prefix MAJOR_ALL MAJOR I J realcur="${cur##*,}" prefix="${cur%$realcur}" for I in /sys/dev/block/*; do J=${I##*/} MAJOR_ALL="$MAJOR_ALL ${J%%:*}" done for WORD in $MAJOR_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then MAJOR="$WORD $MAJOR" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$MAJOR" -S ',' -- $realcur) ) return 0 ;; '-o'|'--output') local prefix realcur LSBLK_COLS realcur="${cur##*,}" prefix="${cur%$realcur}" for WORD in $LSBLK_COLS_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then LSBLK_COLS="$WORD $LSBLK_COLS" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$LSBLK_COLS" -S ',' -- $realcur) ) return 0 ;; '-x'|'--sort') compopt -o nospace COMPREPLY=( $(compgen -W "$LSBLK_COLS_ALL" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--all --bytes --nodeps --discard --exclude --fs --help --include --json --ascii --list --perms --noheadings --output --output-all --paths --pairs --raw --inverse --topology --scsi --sort --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -W "$($1 -pnro name)" -- $cur) ) return 0 } complete -F _lsblk_module lsblk completions/gsettings000064400000005415152525375750011057 0ustar00 # Check for bash [ -z "$BASH_VERSION" ] && return #################################################################################################### __gsettings() { local choices coffset schemadir if [ ${COMP_CWORD} -gt 2 ]; then if [ ${COMP_WORDS[1]} = --schemadir ]; then # this complexity is needed to perform correct tilde expansion schemadir=$(eval "echo --schemadir ${COMP_WORDS[2]}") coffset=2 else coffset=0 fi else coffset=0 fi case "$((${COMP_CWORD}-$coffset))" in 1) choices=$'--schemadir\n--version\nhelp \nlist-schemas\nlist-relocatable-schemas\nlist-keys \nlist-children \nlist-recursively \nget \nrange \nset \nreset \nreset-recursively \nwritable \nmonitor \ndescribe ' ;; 2) case "${COMP_WORDS[$(($coffset+1))]}" in --schemadir) COMPREPLY=($(compgen -o dirnames -- ${COMP_WORDS[${COMP_CWORD}]})) return 0 ;; help) choices=$'list-schemas\nlist-relocatable-schemas\nlist-keys\nlist-children\nlist-recursively\nget\nrange\nset\nreset\nreset-recursively\nwritable\nmonitor' ;; list-keys|list-children|list-recursively|reset-recursively) choices="$(gsettings $schemadir list-schemas 2> /dev/null)"$'\n'"$(gsettings $schemadir list-relocatable-schemas 2> /dev/null | sed -e 's.$.:/.')" ;; list-schemas) COMPREPLY=($(compgen -W "--print-paths" -- ${COMP_WORDS[${COMP_CWORD}]})) return 0 ;; get|range|set|reset|writable|monitor|describe) choices="$(gsettings $schemadir list-schemas 2> /dev/null | sed -e 's.$. .')"$'\n'"$(gsettings $schemadir list-relocatable-schemas 2> /dev/null | sed -e 's.$.:/.')" ;; esac ;; 3) case "${COMP_WORDS[$(($coffset+1))]}" in set) choices="$(gsettings $schemadir list-keys ${COMP_WORDS[$(($coffset+2))]} 2> /dev/null | sed -e 's.$. .')" ;; get|range|reset|writable|monitor|describe) choices="$(gsettings $schemadir list-keys ${COMP_WORDS[$(($coffset+2))]} 2> /dev/null)" ;; esac ;; 4) case "${COMP_WORDS[$(($coffset+2))]}" in set) range=($(gsettings $schemadir range ${COMP_WORDS[$(($coffset+2))]} ${COMP_WORDS[$(($coffset+3))]} 2> /dev/null)) case "${range[0]}" in enum) unset range[0] ;; *) unset range ;; esac local IFS=$'\n' choices="${range[*]}" ;; esac ;; esac local IFS=$'\n' COMPREPLY=($(compgen -W "${choices}" -- "${COMP_WORDS[${COMP_CWORD}]}")) } #################################################################################################### complete -o nospace -F __gsettings gsettings completions/wdctl000064400000002533152525375750010163 0ustar00_wdctl_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-f'|'--flags') local FLAGS FLAGS="ALARMONLY CARDRESET EXTERN1 EXTERN2 FANFAULT KEEPALIVEPING MAGICCLOSE OVERHEAT POWEROVER POWERUNDER PRETIMEOUT SETTIMEOUT" COMPREPLY=( $(compgen -W "$FLAGS" -- $cur) ) return 0 ;; '-o'|'--output') local prefix realcur OUTPUT_ALL OUTPUT realcur="${cur##*,}" prefix="${cur%$realcur}" OUTPUT_ALL="FLAG DESCRIPTION STATUS BOOT-STATUS DEVICE" for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) ) return 0 ;; '-s'|'--settimeout') COMPREPLY=( $(compgen -W "seconds" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--flags --noflags --noident --noheadings --oneline --output --raw --notimeouts --settimeout --flags-only --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- ${cur:-"/dev/"}) ) return 0 } complete -F _wdctl_module wdctl completions/ul000064400000001217152525375750007464 0ustar00_ul_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-t'|'--terminal') local TERM_LIST I TERM_LIST='' for I in /usr/share/terminfo/?/*; do TERM_LIST+="${I##*/} " done COMPREPLY=( $(compgen -W "$TERM_LIST" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--terminal --indicated --version --help" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _ul_module ul completions/mkfs.minix000064400000001312152525375750011123 0ustar00_mkfs.minix_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-i'|'--inodes') COMPREPLY=( $(compgen -W "inodes" -- $cur) ) return 0 ;; '-l'|'--badblocks') compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 ;; '-n'|'--namelength') COMPREPLY=( $(compgen -W "14 30 60" -- $cur) ) return 0 ;; esac case $cur in -*) OPTS="--namelength --inodes --check --badblocks --help --version -1 -2 -3" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) ) return 0 } complete -F _mkfs.minix_module mkfs.minix completions/script000064400000001233152525375750010346 0ustar00_script_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-c'|'--command') compopt -o bashdefault COMPREPLY=( $(compgen -c -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in '=') cur=${cur#=} ;; -*) OPTS="--append --command --return --flush --force --quiet --timing= --version --help" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _script_module script completions/imunify360-agent000064400000030352152525375750012053 0ustar00# bash completion for imunify360-agent # Auto-generated by imunify360-agent completions bash _imunify360_agent_completions() { local cur prev words cword if type _init_completion &>/dev/null; then _init_completion || return else COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" words=("${COMP_WORDS[@]}") cword=$COMP_CWORD fi # Build the command path from words local cmd_path="" local i for (( i=1; i < cword; i++ )); do case "${words[i]}" in -*) continue ;; *) cmd_path="${cmd_path:+${cmd_path} }${words[i]}" ;; esac done case "$cmd_path" in "config show defaults") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "feature-management native disable") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "feature-management native enable") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "feature-management native status") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "wordpress-plugin rules disable") COMPREPLY=($(compgen -W "--domains --json --rule --user --verbose -v" -- "$cur")) return ;; "wordpress-plugin rules enable") COMPREPLY=($(compgen -W "--domains --json --rule --user --verbose -v" -- "$cur")) return ;; "wordpress-plugin rules list-disabled") COMPREPLY=($(compgen -W "--domains --json --limit --offset --user --verbose -v" -- "$cur")) return ;; "wordpress-plugin waf set") COMPREPLY=($(compgen -W "--all-users --json --no-all-users --status --users --verbose -v" -- "$cur")) return ;; "wordpress-plugin waf status") COMPREPLY=($(compgen -W "--json --limit --offset --source --status --user --verbose -v" -- "$cur")) return ;; "3rdparty conflicts") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "advisor apply") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "advisor apply-all") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "analyst-cleanup get-requests") COMPREPLY=($(compgen -W "--json --limit --offset --username --verbose -v" -- "$cur")) return ;; "analyst-cleanup is-allowed") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "analyst-cleanup request") COMPREPLY=($(compgen -W "--email --json --message --username --verbose -v" -- "$cur")) return ;; "billing get-config") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "billing sync") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "config get-many") COMPREPLY=($(compgen -W "--json --users --verbose -v" -- "$cur")) return ;; "config patch") COMPREPLY=($(compgen -W "--data --json --user --verbose -v" -- "$cur")) return ;; "config patch-many") COMPREPLY=($(compgen -W "--data --json --users --verbose -v" -- "$cur")) return ;; "config show") COMPREPLY=($(compgen -W "defaults --json --user --verbose -v" -- "$cur")) return ;; "config update") COMPREPLY=($(compgen -W "--items --json --user --verbose -v" -- "$cur")) return ;; "eula accept") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "eula show") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "feature-management defaults") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "feature-management disable") COMPREPLY=($(compgen -W "--feature --json --users --verbose -v" -- "$cur")) return ;; "feature-management enable") COMPREPLY=($(compgen -W "--feature --json --users --verbose -v" -- "$cur")) return ;; "feature-management get") COMPREPLY=($(compgen -W "--json --user --verbose -v" -- "$cur")) return ;; "feature-management list") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "feature-management native") COMPREPLY=($(compgen -W "disable enable status" -- "$cur")) return ;; "feature-management show") COMPREPLY=($(compgen -W "--json --limit --offset --order-by --search --verbose -v" -- "$cur")) return ;; "hook add") COMPREPLY=($(compgen -W "--event --json --path --verbose -v" -- "$cur")) return ;; "hook add-native") COMPREPLY=($(compgen -W "--event --json --path --verbose -v" -- "$cur")) return ;; "hook delete") COMPREPLY=($(compgen -W "--event --json --path --verbose -v" -- "$cur")) return ;; "hook list") COMPREPLY=($(compgen -W "--event --json --verbose -v" -- "$cur")) return ;; "login get") COMPREPLY=($(compgen -W "--json --username --verbose -v" -- "$cur")) return ;; "login pam") COMPREPLY=($(compgen -W "--json --password --username --verbose -v" -- "$cur")) return ;; "notifications-config patch") COMPREPLY=($(compgen -W "--data --json --verbose -v" -- "$cur")) return ;; "notifications-config show") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "notifications-config update") COMPREPLY=($(compgen -W "--items --json --verbose -v" -- "$cur")) return ;; "permissions list") COMPREPLY=($(compgen -W "--json --user --verbose -v" -- "$cur")) return ;; "support send") COMPREPLY=($(compgen -W "--attachments --cln --description --email --json --subject --verbose -v" -- "$cur")) return ;; "wordpress-plugin install-and-update") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "wordpress-plugin install-on-new-sites") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "wordpress-plugin list-incidents") COMPREPLY=($(compgen -W "--by-abuser-ip --by-country-code --by-domain --include-hidden --json --limit --no-include-hidden --offset --order-by --search --since --site-search --to --user --verbose -v" -- "$cur")) return ;; "wordpress-plugin list-sites") COMPREPLY=($(compgen -W "--json --limit --offset --user --verbose -v" -- "$cur")) return ;; "wordpress-plugin rules") COMPREPLY=($(compgen -W "disable enable list-disabled" -- "$cur")) return ;; "wordpress-plugin tidy-up") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "wordpress-plugin update") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "wordpress-plugin waf") COMPREPLY=($(compgen -W "set status" -- "$cur")) return ;; "3rdparty") COMPREPLY=($(compgen -W "conflicts" -- "$cur")) return ;; "add-sudouser") COMPREPLY=($(compgen -W "--json --user --verbose -v" -- "$cur")) return ;; "advisor") COMPREPLY=($(compgen -W "apply apply-all" -- "$cur")) return ;; "analyst-cleanup") COMPREPLY=($(compgen -W "get-requests is-allowed request" -- "$cur")) return ;; "auth-cloud") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "auth-cloud-refresh-token") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "billing") COMPREPLY=($(compgen -W "get-config sync" -- "$cur")) return ;; "check-domains") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "checkdb") COMPREPLY=($(compgen -W "--json --no-recreate-schema --recreate-schema --verbose -v" -- "$cur")) return ;; "completions") COMPREPLY=($(compgen -W "" -- "$cur")) return ;; "config") COMPREPLY=($(compgen -W "get-many patch patch-many show update" -- "$cur")) return ;; "delete-sudouser") COMPREPLY=($(compgen -W "--json --user --verbose -v" -- "$cur")) return ;; "disable-plugin") COMPREPLY=($(compgen -W "--json --plugin-name --verbose -v" -- "$cur")) return ;; "doctor") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "enable-plugin") COMPREPLY=($(compgen -W "--json --plugin-name --verbose -v" -- "$cur")) return ;; "eula") COMPREPLY=($(compgen -W "accept show" -- "$cur")) return ;; "feature-management") COMPREPLY=($(compgen -W "defaults disable enable get list native show" -- "$cur")) return ;; "get-news") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "get-package-versions") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "hook") COMPREPLY=($(compgen -W "add add-native delete list" -- "$cur")) return ;; "infected-domains") COMPREPLY=($(compgen -W "--json --limit --offset --verbose -v" -- "$cur")) return ;; "list-docroots") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "login") COMPREPLY=($(compgen -W "get pam" -- "$cur")) return ;; "notifications-config") COMPREPLY=($(compgen -W "patch show update" -- "$cur")) return ;; "permissions") COMPREPLY=($(compgen -W "list" -- "$cur")) return ;; "plesk-stats") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "register") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "rstatus") COMPREPLY=($(compgen -W "--json --no-paid --paid --verbose -v" -- "$cur")) return ;; "support") COMPREPLY=($(compgen -W "send" -- "$cur")) return ;; "unregister") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "update") COMPREPLY=($(compgen -W "--force --json --list --no-force --no-list --verbose --version -v" -- "$cur")) return ;; "update-license") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "version") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "wakeup") COMPREPLY=($(compgen -W "--json --verbose -v" -- "$cur")) return ;; "wordpress-plugin") COMPREPLY=($(compgen -W "install-and-update install-on-new-sites list-incidents list-sites rules tidy-up update waf" -- "$cur")) return ;; "") COMPREPLY=($(compgen -W "3rdparty add-sudouser advisor analyst-cleanup auth-cloud auth-cloud-refresh-token billing check-domains checkdb completions config delete-sudouser disable-plugin doctor enable-plugin eula feature-management get-news get-package-versions hook infected-domains list-docroots login notifications-config permissions plesk-stats register rstatus support unregister update update-license version wakeup wordpress-plugin --console-log-level --log-config --remote-addr" -- "$cur")) return ;; esac } complete -F _imunify360_agent_completions imunify360-agent completions/look000064400000001253152525375750010010 0ustar00_look_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-t'|'--terminate') COMPREPLY=( $(compgen -W "char" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--alternative --alphanum --ignore-case --terminate --version --help" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac case $COMP_CWORD in 1) COMPREPLY=( $(compgen -W "$(look "$cur")" -- $cur) ) ;; 2) local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) ;; esac return 0 } complete -F _look_module look completions/grub000064400000026641152525375750010013 0ustar00# # Bash completion for grub # # Copyright (C) 2010 Free Software Foundation, Inc. # # GRUB is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # GRUB is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GRUB. If not, see . # bash completion for grub __grub_dir() { local i c=1 boot_dir for (( c=1; c <= ${#COMP_WORDS[@]}; c++ )); do i="${COMP_WORDS[c]}" case "$i" in --boot-directory) c=$((++c)) i="${COMP_WORDS[c]}" boot_dir="${i##*=}"; break ;; esac done boot_dir=${boot_dir-/boot} echo "${boot_dir%/}/grub2" } # This function generates completion reply with compgen # - arg: accepts 1, 2, 3, or 4 arguments # $1 wordlist separate by space, tab or newline # $2 (optional) prefix to add # $3 (optional) current word to complete # $4 (optional) suffix to add __grubcomp () { local cur="${COMP_WORDS[COMP_CWORD]}" if [ $# -gt 2 ]; then cur="$3" fi case "$cur" in --*=) COMPREPLY=() ;; *) local IFS=' '$'\t'$'\n' COMPREPLY=($(compgen -P "${2-}" -W "${1-}" -S "${4-}" -- "$cur")) ;; esac } # Function that return long options from the help of the command # - arg: $1 (optional) command to get the long options from __grub_get_options_from_help () { local prog if [ $# -ge 1 ]; then prog="$1" else prog="${COMP_WORDS[0]}" fi local i IFS=" "$'\t'$'\n' for i in $(LC_ALL=C $prog --help) do case $i in --*) echo "${i%=*}";; esac done } # Function that return long options from the usage of the command # - arg: $1 (optional) command to get the long options from __grub_get_options_from_usage () { local prog if [ $# -ge 1 ]; then prog="$1" else prog="${COMP_WORDS[0]}" fi local i IFS=" "$'\t'$'\n' for i in $(LC_ALL=C $prog --usage) do case $i in \[--*\]) i=${i#[} # Remove leading [ echo ${i%%?(=*)]} # Remove optional value and trailing ] ;; esac done } __grub_get_last_option () { local i for (( i=$COMP_CWORD-1; i > 0; i-- )); do if [[ "${COMP_WORDS[i]}" == -* ]]; then echo "${COMP_WORDS[i]}" break; fi done } __grub_list_menuentries () { local cur="${COMP_WORDS[COMP_CWORD]}" local config_file=$(__grub_dir)/grub.cfg if [ -f "$config_file" ];then local IFS=$'\n' COMPREPLY=( $(compgen \ -W "$( awk -F "[\"']" '/menuentry/ { print $2 }' $config_file )" \ -- "$cur" )) #'# Help emacs syntax highlighting fi } __grub_list_modules () { local grub_dir=$(__grub_dir) local IFS=$'\n' COMPREPLY=( $( compgen -f -X '!*/*.mod' -- "${grub_dir}/$cur" | { while read -r tmp; do [ -n $tmp ] && { tmp=${tmp##*/} printf '%s\n' ${tmp%.mod} } done } )) } # # grub-set-default & grub-reboot # _grub_set_entry () { local cur prev split=false COMPREPLY=() cur=`_get_cword` prev=${COMP_WORDS[COMP_CWORD-1]} _split_longopt && split=true case "$prev" in --boot-directory) _filedir -d return ;; esac $split && return 0 if [[ "$cur" == -* ]]; then __grubcomp "$(__grub_get_options_from_help)" else # Default complete with a menuentry __grub_list_menuentries fi } __grub_set_default_program="grub2-set-default" have ${__grub_set_default_program} && \ complete -F _grub_set_entry -o filenames ${__grub_set_default_program} unset __grub_set_default_program __grub_reboot_program="grub2-reboot" have ${__grub_reboot_program} && \ complete -F _grub_set_entry -o filenames ${__grub_reboot_program} unset __grub_reboot_program # # grub-editenv # _grub_editenv () { local cur prev COMPREPLY=() cur=`_get_cword` prev=${COMP_WORDS[COMP_CWORD-1]} case "$prev" in create|list|set|unset) COMPREPLY=( "" ) return ;; esac __grubcomp "$(__grub_get_options_from_help) create list set unset" } __grub_editenv_program="grub2-editenv" have ${__grub_editenv_program} && \ complete -F _grub_editenv -o filenames ${__grub_editenv_program} unset __grub_editenv_program # # grub-mkconfig # _grub_mkconfig () { local cur prev COMPREPLY=() cur=`_get_cword` if [[ "$cur" == -* ]]; then __grubcomp "$(__grub_get_options_from_help)" else _filedir fi } __grub_mkconfig_program="grub2-mkconfig" have ${__grub_mkconfig_program} && \ complete -F _grub_mkconfig -o filenames ${__grub_mkconfig_program} unset __grub_mkconfig_program # # grub-setup # _grub_setup () { local cur prev split=false COMPREPLY=() cur=`_get_cword` prev=${COMP_WORDS[COMP_CWORD-1]} _split_longopt && split=true case "$prev" in -d|--directory) _filedir -d return ;; esac $split && return 0 if [[ "$cur" == -* ]]; then __grubcomp "$(__grub_get_options_from_help)" else # Default complete with a filename _filedir fi } __grub_bios_setup_program="grub2-bios-setup" have ${__grub_bios_setup_program} && \ complete -F _grub_setup -o filenames ${__grub_bios_setup_program} unset __grub_bios_setup_program __grub_sparc64_setup_program="grub2-sparc64-setup" have ${__grub_sparc64_setup_program} && \ complete -F _grub_setup -o filenames ${__grub_sparc64_setup_program} unset __grub_sparc64_setup_program # # grub-get-kernel-settings # _grub_get_kernel_settings () { local cur COMPREPLY=() cur=`_get_cword` if [[ "$cur" == -* ]]; then __grubcomp "$(__grub_get_options_from_help)" else # Default complete with a filename _filedir fi } __grub_get_kernel_settings_program="grub2-get-kernel-settings" have ${__grub_get_kernel_settings_program} && \ complete -F _grub_get_kernel_settings -o filenames ${__grub_get_kernel_settings_program} unset __grub_get_kernel_settings_program # # grub-install # _grub_install () { local cur prev last split=false COMPREPLY=() cur=`_get_cword` prev=${COMP_WORDS[COMP_CWORD-1]} last=$(__grub_get_last_option) _split_longopt && split=true case "$prev" in --boot-directory) _filedir -d return ;; --disk-module) __grubcomp "biosdisk ata" return ;; esac $split && return 0 if [[ "$cur" == -* ]]; then __grubcomp "$(__grub_get_options_from_help)" else case "$last" in --modules) __grub_list_modules return ;; esac # Default complete with a filename _filedir fi } __grub_install_program="grub2-install" have ${__grub_install_program} && \ complete -F _grub_install -o filenames ${__grub_install_program} unset __grub_install_program # # grub-mkfont # _grub_mkfont () { local cur COMPREPLY=() cur=`_get_cword` if [[ "$cur" == -* ]]; then __grubcomp "$(__grub_get_options_from_help)" else # Default complete with a filename _filedir fi } __grub_mkfont_program="grub2-mkfont" have ${__grub_mkfont_program} && \ complete -F _grub_mkfont -o filenames ${__grub_mkfont_program} unset __grub_mkfont_program # # grub-mkrescue # _grub_mkrescue () { local cur prev last COMPREPLY=() cur=`_get_cword` prev=${COMP_WORDS[COMP_CWORD-1]} last=$(__grub_get_last_option) if [[ "$cur" == -* ]]; then __grubcomp "$(__grub_get_options_from_help)" else case "$last" in --modules) __grub_list_modules return ;; esac # Default complete with a filename _filedir fi } __grub_mkrescue_program="grub2-mkrescue" have ${__grub_mkrescue_program} && \ complete -F _grub_mkrescue -o filenames ${__grub_mkrescue_program} unset __grub_mkrescue_program # # grub-mkimage # _grub_mkimage () { local cur prev split=false COMPREPLY=() cur=`_get_cword` prev=${COMP_WORDS[COMP_CWORD-1]} _split_longopt && split=true case "$prev" in -d|--directory|-p|--prefix) _filedir -d return ;; -O|--format) # Get available format from help local prog=${COMP_WORDS[0]} __grubcomp "$(LC_ALL=C $prog --help | \ awk -F ":" '/available formats/ { print $2 }' | \ sed 's/, / /g')" return ;; esac $split && return 0 if [[ "$cur" == -* ]]; then __grubcomp "$(__grub_get_options_from_help)" else # Default complete with a filename _filedir fi } __grub_mkimage_program="grub2-mkimage" have ${__grub_mkimage_program} && \ complete -F _grub_mkimage -o filenames ${__grub_mkimage_program} unset __grub_mkimage_program # # grub-mkpasswd-pbkdf2 # _grub_mkpasswd_pbkdf2 () { local cur COMPREPLY=() cur=`_get_cword` if [[ "$cur" == -* ]]; then __grubcomp "$(__grub_get_options_from_help)" else # Default complete with a filename _filedir fi } __grub_mkpasswd_pbkdf2_program="grub2-mkpasswd-pbkdf2" have ${__grub_mkpasswd_pbkdf2_program} && \ complete -F _grub_mkpasswd_pbkdf2 -o filenames ${__grub_mkpasswd_pbkdf2_program} unset __grub_mkpasswd_pbkdf2_program # # grub-probe # _grub_probe () { local cur prev split=false COMPREPLY=() cur=`_get_cword` prev=${COMP_WORDS[COMP_CWORD-1]} _split_longopt && split=true case "$prev" in -t|--target) # Get target type from help local prog=${COMP_WORDS[0]} __grubcomp "$(LC_ALL=C $prog --help | \ awk -F "[()]" '/--target=/ { print $2 }' | \ sed 's/|/ /g')" return ;; esac $split && return 0 if [[ "$cur" == -* ]]; then __grubcomp "$(__grub_get_options_from_help)" else # Default complete with a filename _filedir fi } __grub_probe_program="grub2-probe" have ${__grub_probe_program} && \ complete -F _grub_probe -o filenames ${__grub_probe_program} unset __grub_probe_program # # grub-script-check # _grub_script_check () { local cur COMPREPLY=() cur=`_get_cword` if [[ "$cur" == -* ]]; then __grubcomp "$(__grub_get_options_from_help)" else # Default complete with a filename _filedir fi } __grub_script_check_program="grub2-script-check" have ${__grub_script_check_program} && \ complete -F _grub_script_check -o filenames ${__grub_script_check_program} # Local variables: # mode: shell-script # sh-basic-offset: 4 # sh-indent-comment: t # indent-tabs-mode: nil # End: # ex: ts=4 sw=4 et filetype=sh completions/nsenter000064400000002223152525375750010520 0ustar00_nsenter_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-S'|'--uid') COMPREPLY=( $(compgen -W "uid" -- $cur) ) return 0 ;; '-G'|'--gid') COMPREPLY=( $(compgen -W "gid" -- $cur) ) return 0 ;; '-t'|'--target') local PIDS PIDS=$(cd /proc && echo [0-9]*) COMPREPLY=( $(compgen -W "$PIDS" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in '=') # FIXME: --root and --wd should use get only # directories as compgen output. If $cur is # overwrote the same way as below in case segment # for $prev the command-line will get mangled. cur=${cur#=} ;; -*) OPTS=" --all --target --mount= --uts= --ipc= --net= --pid= --cgroup= --user= --setuid --setgid --preserve-credentials --root= --wd= --no-fork --help --version " COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _nsenter_module nsenter completions/chmem000064400000000765152525375750010144 0ustar00_chmem_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS=" --enable --disable --blocks --verbose --zone --help --version " COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -W "size range blockrange" -- $cur) ) return 0 } complete -F _chmem_module chmem completions/blkzone000064400000001713152525375750010511 0ustar00_blkzone_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-o'|'--offset') COMPREPLY=( $(compgen -W "sector" -- $cur) ) return 0 ;; '-l'|'--length') COMPREPLY=( $(compgen -W "size" -- $cur) ) return 0 ;; '-c'|'--count') COMPREPLY=( $(compgen -W "number" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) case $prev in 'report'|'reset') OPTS="--verbose --offset --length --count" ;; *) OPTS="--help --version" ;; esac COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; *) case $prev in 'report'|'reset') ;; *) OPTS="report reset" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) ;; esac return 0 ;; esac COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) ) return 0 } complete -F _blkzone_module blkzone completions/systemd-cgls000064400000004450152525375750011464 0ustar00# systemd-cgls(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . __contains_word() { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done } __get_machines() { local a b machinectl list --no-legend --no-pager | { while read a b; do echo " $a"; done; }; } __get_units_have_cgroup() { systemctl $1 list-units | { while read -r a b c d; do [[ $c == "active" && ${a##*.} =~ (service|socket|mount|swap|slice|scope) ]] && echo " $a" done }; } _systemd_cgls() { local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local i verb comps local -A OPTS=( [STANDALONE]='-h --help --version --all -l --full -k --no-pager' [ARG]='-M --machine -u --unit --user-unit' ) _init_completion || return if __contains_word "$prev" ${OPTS[ARG]}; then case $prev in --machine|-M) comps=$( __get_machines ) ;; --unit|-u) comps=$( __get_units_have_cgroup --system ) ;; --user-unit) comps=$( __get_units_have_cgroup --user ) ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 fi COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) } complete -F _systemd_cgls systemd-cgls completions/cfdisk000064400000001042152525375750010303 0ustar00_cfdisk_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-L'|'--color') COMPREPLY=( $(compgen -W "auto never always" -- $cur) ) return 0 ;; '-V'|'--version'|'h'|'--help') return 0 ;; esac case $cur in -*) OPTS=" --color --zero --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) ) return 0 } complete -F _cfdisk_module cfdisk completions/portablectl000064400000007622152525375750011365 0ustar00# portablectl(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . __contains_word () { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done } __get_machines() { local a b machinectl list --no-legend --no-pager 2>/dev/null | { while read a b; do echo " $a"; done; }; } _portablectl() { local i n comps verb local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local -A OPTS=( [STANDALONE]='-q --quiet --runtime --no-reload --cat --no-pager --no-legend --no-ask-password -h --help --version' [ARG]='-p --profile --copy -H --host -M --machine' ) local -A VERBS=( [STANDALONE]='list' [IMAGE]='attach detach inspect is-attached set-limit' [IMAGES]='remove' [IMAGE_WITH_BOOL]='read-only' ) if __contains_word "$prev" ${OPTS[ARG]}; then case $prev in --profile|-p) comps="default nonetwork strict trusted" ;; --copy) comps="copy symlink auto" ;; --host|-H) comps=$(compgen -A hostname) ;; --machine|-M) comps=$( __get_machines ) ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 fi if [[ "$cur" = -* ]]; then COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) return 0 fi for ((i=0; i < COMP_CWORD; i++)); do if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]} && ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then verb=${COMP_WORDS[i]} break fi done n=$(($COMP_CWORD - $i)) if [[ -z $verb ]]; then comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[STANDALONE]}; then comps='' elif __contains_word "$verb" ${VERBS[IMAGE]}; then if [[ $n == 1 ]]; then comps=$( compgen -A file -- "$cur" ) compopt -o filenames else comps='' fi elif __contains_word "$verb" ${VERBS[IMAGES]}; then comps=$( compgen -A file -- "$cur" ) compopt -o filenames elif __contains_word "$verb" ${VERBS[IMAGE_WITH_BOOL]}; then if [[ $n == 1 ]]; then comps=$( compgen -A file -- "$cur" ) compopt -o filenames elif [[ $n == 2 ]]; then comps='yes no' else comps='' fi fi COMPREPLY=( $(compgen -o filenames -W '$comps' -- "$cur") ) return 0 } complete -F _portablectl portablectl completions/logger000064400000003021152525375750010316 0ustar00_logger_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-f'|'--file'|'--journald') local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 ;; '-n'|'--server') COMPREPLY=( $(compgen -A hostname -- $cur) ) return 0 ;; '-P'|'--port') COMPREPLY=( $(compgen -W "$(awk '$1 ~ /^syslog$/ {split($2, a, "/"); print a[1]}' /etc/services)" -- $cur) ) return 0 ;; '-p'|'--priority') COMPREPLY=( $(compgen -W "{auth,authpriv,cron,daemon,ftp,lpr,mail,news,security}.{alert,crit,debug,emerg,err,error}" -- $cur) ) return 0 ;; '-t'|'--tag') COMPREPLY=( $(compgen -W "tag" -- $cur) ) return 0 ;; '-u'|'--socket') COMPREPLY=( $(compgen -W "$(awk '$NF ~ /^\// {print $NF}' /proc/net/unix)" -- $cur) ) return 0 ;; '--socket-errors') COMPREPLY=( $(compgen -W "on off auto" -- $cur) ) return 0 ;; '--msgid') COMPREPLY=( $(compgen -W "msgid" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS=" --file --help --id --journald --msgid --no-act --octet-count --port --prio-prefix --priority --rfc3164 --rfc5424 --server --size --skip-empty --socket --socket-errors --stderr --tag --tcp --udp --version " COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac return 0 } complete -F _logger_module logger completions/mcookie000064400000001127152525375750010472 0ustar00_mcookie_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-f'|'--file') local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 ;; '-m'|'--max-size') COMPREPLY=( $(compgen -W "bytes" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--file --max-size --verbose --version --help" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac return 0 } complete -F _mcookie_module mcookie completions/hwclock000064400000001652152525375750010501 0ustar00_hwclock_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-f'|'--rtc'|'--adjfile') local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 ;; '--date') COMPREPLY=( $(compgen -W "time" -- $cur) ) return 0 ;; '--epoch') COMPREPLY=( $(compgen -W "year" -- $cur) ) return 0 ;; '-h'|'-?'|'--help'|'-v'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--help --show --get --set --hctosys --systohc --systz --adjust --getepoch --setepoch --predict --version --utc --localtime --rtc --directisa --date --epoch --update-drift --noadjfile --adjfile --test --debug" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac return 0 } complete -F _hwclock_module hwclock completions/pivot_root000064400000000603152525375750011246 0ustar00_pivot_root_module() { local cur prev COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $COMP_CWORD in 1|2) local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -o dirnames -- ${cur:-"/"}) ) ;; esac return 0 } complete -F _pivot_root_module pivot_root completions/chsh000064400000000770152525375750007774 0ustar00_chsh_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-s'|'--shell') COMPREPLY=( $(compgen -W "$($1 -l)" -- $cur) ) return 0 ;; '-u'|'--help'|'-v'|'--version') return 0 ;; esac case $cur in -*) OPTS="--shell --list-shells --version --help" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -u -- $cur) ) return 0 } complete -F _chsh_module chsh completions/findmnt000064400000006122152525375750010503 0ustar00_findmnt_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-p'|'--poll') COMPREPLY=( $(compgen -W "=list" -- $cur) ) return 0 ;; '-w'|'--timeout') COMPREPLY=( $(compgen -W "timeout" -- $cur) ) return 0 ;; '-d'|'--direction') COMPREPLY=( $(compgen -W "forward backward" -- $cur) ) return 0 ;; '-F'|'--tab-file') local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 ;; '-N'|'--task') local TID='' I ARR for I in /proc/*/mountinfo; do IFS=/ read -ra ARR <<< "$I"; TID+="${ARR[2]} "; done COMPREPLY=( $(compgen -W "$TID" -- $cur) ) return 0 ;; '-O'|'--options') local MTAB_3RD I declare -a TMP_ARR declare -A MNT_OPTS while read MTAB_3RD; do IFS=',' read -ra TMP_ARR <<<"$MTAB_3RD" for I in ${TMP_ARR[@]}; do MNT_OPTS[$I]='1' done done < <($1 -rno OPTIONS) COMPREPLY=( $(compgen -W "${!MNT_OPTS[@]}" -- $cur) ) return 0 ;; '-o'|'--output') local prefix realcur OUTPUT_ALL OUTPUT realcur="${cur##*,}" prefix="${cur%$realcur}" OUTPUT_ALL="SOURCE TARGET FSTYPE OPTIONS VFS-OPTIONS FS-OPTIONS LABEL UUID PARTLABEL PARTUUID MAJ\:MIN ACTION OLD-TARGET OLD-OPTIONS SIZE AVAIL USED USE% FSROOT TID ID OPT-FIELDS PROPAGATION FREQ PASSNO" for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) ) return 0 ;; '-t'|'--types') local TYPES TYPES="adfs affs autofs cifs coda coherent cramfs debugfs devpts efs ext2 ext3 ext4 hfs hfsplus hpfs iso9660 jfs minix msdos ncpfs nfs nfs4 ntfs proc qnx4 ramfs reiserfs romfs squashfs smbfs sysv tmpfs ubifs udf ufs umsdos usbfs vfat xenix xfs" COMPREPLY=( $(compgen -W "$TYPES" -- $cur) ) return 0 ;; '-S'|'--source') local DEV_MPOINT DEV_MPOINT=$($1 -rno SOURCE | grep ^/dev) COMPREPLY=( $(compgen -W "$DEV_MPOINT" -- $cur) ) return 0 ;; '-T'|'--target') local DEV_MPOINT DEV_MPOINT=$($1 -rno TARGET) COMPREPLY=( $(compgen -W "$DEV_MPOINT" -- $cur) ) return 0 ;; '-M'|'--mountpoint') local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -o dirnames -- ${cur:-"/"}) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--fstab --mtab --kernel --poll --timeout --all --ascii --canonicalize --df --direction --evaluate --tab-file --first-only --invert --json --list --task --noheadings --notruncate --options --output --pairs --raw --types --nofsroot --submounts --source --target --mountpoint --help --tree --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local DEV_MPOINT DEV_MPOINT=$($1 -rno TARGET,SOURCE) COMPREPLY=( $(compgen -W "$DEV_MPOINT" -- $cur) ) return 0 } complete -F _findmnt_module findmnt completions/blkid000064400000004056152525375750010135 0ustar00_blkid_module() { local cur prev OPTS OUTPUT_ALL OUTPUT_ALL='' COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-c'|'--cache-file') local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 ;; '-o'|'--output') COMPREPLY=( $(compgen -W "value device export full" -- $cur) ) return 0 ;; '-s'|'--match-tag') COMPREPLY=( $(compgen -W "tag" -- $cur) ) return 0 ;; '-t'|'--match-token') COMPREPLY=( $(compgen -W "TYPE= LABEL= UUID=" -- $cur) ) return 0 ;; '-L'|'--label') COMPREPLY=( $(compgen -W "$(cd /dev/disk/by-label/ 2>/dev/null && echo *)" -- $cur) ) return 0 ;; '-U'|'--uuid') COMPREPLY=( $(compgen -W "$(cd /dev/disk/by-uuid/ 2>/dev/null && echo *)" -- $cur) ) return 0 ;; '-S'|'--size') COMPREPLY=( $(compgen -W "size" -- $cur) ) return 0 ;; '-O'|'--offset') COMPREPLY=( $(compgen -W "offset" -- $cur) ) return 0 ;; '-u'|'--usages') OUTPUT_ALL={,no}{filesystem,raid,crypto,other} ;; '-n'|'--match-types') OUTPUT_ALL=" $(awk '{print $NF}' /proc/filesystems) $(\ls /lib/modules/$(uname -r)/kernel/fs) " ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac if [ -n "$OUTPUT_ALL" ]; then local prefix realcur OUTPUT_ALL OUTPUT realcur="${cur##*,}" prefix="${cur%$realcur}" for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- "$realcur") ) return 0 fi case $cur in -*) OPTS=" --cache-file --no-encoding --garbage-collect --output --list-filesystems --match-tag --match-token --list-one --label --uuid --probe --info --size --offset --usages --match-types --help --version " COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) ) return 0 } complete -F _blkid_module blkid completions/taskset000064400000002267152525375750010530 0ustar00_taskset_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-c'|'--cpu-list') local prefix realcur CPULIST_ALL CPULIST realcur="${cur##*,}" prefix="${cur%$realcur}" CPULIST_ALL=$(sed 's/^/{/; s/-/../g; s/,/} {/g; s/$/}/' /sys/devices/system/cpu/online) for WORD in $(eval echo $CPULIST_ALL); do if ! [[ $prefix == *"$WORD"* ]]; then CPULIST="$WORD $CPULIST" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$CPULIST" -S ',' -- $realcur) ) return 0 ;; '-p'|'--pid') local PIDS # FIXME: the pid argument is ambiguous. When # setting an affinity the optarg has to be cpu # mask. The following is good only for getting # affinity. PIDS=$(cd /proc && echo [0-9]*) COMPREPLY=( $(compgen -W "$PIDS" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--all-tasks --pid --cpu-list --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac compopt -o bashdefault COMPREPLY=( $(compgen -c -- $cur) ) return 0 } complete -F _taskset_module taskset completions/rfkill000064400000001641152525375750010330 0ustar00_rfkill_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in 'list'|'block'|'unblock') local targets targets="$(rfkill --output=id,type --noheadings list)" COMPREPLY=( $(compgen -W "all $targets" -- $cur) ) return 0; ;; '-o'|'--output') local prefix realcur OUTPUT realcur="${cur##*,}" prefix="${cur%$realcur}" for WORD in "DEVICE TYPE ID SOFT HARD"; do if ! [[ $prefix == *"$WORD"* ]]; then OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac OPTS=" event list block unblock --json --noheadings --output --raw --help --version " COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 } complete -F _rfkill_module rfkill completions/dracut000064400000006774152525375750010343 0ustar00# # Copyright 2013 Red Hat, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # __contains_word () { local word=$1; shift for w in $*; do [[ $w = $word ]] && return 0; done return 1 } _dracut() { local field_vals= cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local -A OPTS=( [STANDALONE]='-f -v -q -l -H -h -M -N --ro-mnt --force --kernel-only --no-kernel --strip --nostrip --hardlink --nohardlink --noprefix --mdadmconf --nomdadmconf --lvmconf --nolvmconf --debug --profile --verbose --quiet --local --hostonly --no-hostonly --fstab --help --bzip2 --lzma --xz --zstd --no-compress --gzip --list-modules --show-modules --keep --printsize --regenerate-all --noimageifnotneeded --early-microcode --no-early-microcode --print-cmdline --reproducible --uefi' [ARG]='-a -m -o -d -I -k -c -L --kver --add --force-add --add-drivers --omit-drivers --modules --omit --drivers --filesystems --install --fwdir --libdirs --fscks --add-fstab --mount --device --nofscks --kmoddir --conf --confdir --tmpdir --stdlog --compress --prefix --kernel-cmdline --sshkey --persistent-policy --install-optional --loginstall --uefi-stub --kernel-image ' ) if __contains_word "$prev" ${OPTS[ARG]}; then case $prev in --kmoddir|-k|--fwdir|--confdir|--tmpdir) comps=$(compgen -d -- "$cur") compopt -o filenames ;; -c|--conf|--sshkey|--add-fstab|--add-device|-I|--install|--install-optional) comps=$(compgen -f -- "$cur") compopt -o filenames ;; -a|-m|-o|--add|--modules|--omit) comps=$(dracut --list-modules 2>/dev/null) ;; --persistent-policy) comps=$(cd /dev/disk/; echo *) ;; --kver) comps=$(cd /lib/modules; echo [0-9]*) ;; *) return 0 ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 fi if [[ $cur = -* ]]; then COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) return 0 fi } complete -F _dracut dracut completions/last000064400000001665152525375750010016 0ustar00_last_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-f'|'--file') local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 ;; '-n'|'--limit') COMPREPLY=( $(compgen -W "number" -- $cur) ) return 0 ;; '-s'|'--since'|'-t'|'--until'|'-p'|'--present') COMPREPLY=( $(compgen -W "number" -- $cur) ) return 0 ;; '--time-format') COMPREPLY=( $(compgen -W "notime short full iso" -- $cur) ) return 0 ;; esac case $cur in -*) OPTS=" --hostlast --dns --file --fulltimes --ip --limit --nohostname --since --until --present --fullnames --system --time-format --help --version " COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -u -- $cur) ) return 0 } complete -F _last_module last completions/raw000064400000000742152525375750007637 0ustar00_raw_module() { local cur prev COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) local OPTS OPTS="--query --all --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -W "$(for I in /dev/raw/*; do if [ -e $I ]; then echo $I; fi; done)" -- $cur) ) return 0 } complete -F _raw_module raw completions/dnf000064400000023744152525375750007624 0ustar00# dnf completion -*- shell-script -*- # # This file is part of dnf. # # Copyright 2013 (C) Elad Alfassa # Copyright 2014-2015 (C) Igor Gnatenko # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA __dnf_main_options=" -4 -6 -b -c -C -d -e -h -q -R -v -x -y --advisory --advisories --allowerasing --assumeno --assumeyes --best --bugfix --bz --cacheonly --config --color --cve --debuglevel --debugsolver --disableexcludes --disableplugin --disableexcludepkgs --disablerepo --downloadonly --destdir --downloaddir --errorlevel --enableplugin --enablerepo --enhancement --exclude --excludepkgs --help --help-cmd --installroot --newpackage --nodocs --nogpgcheck --noplugins --noautoremove --obsoletes --quiet --randomwait --refresh --releasever --repofrompath --repo --repoid --rpmverbosity --sec-severity --secseverity --security --setopt --skip-broken --showduplicates --verbose --version " __dnf_history_subcmds="info list redo rollback undo userinstalled" __dnf_secseverity_subcmds='Critical Important Low Moderate' __dnf_clean_subcmds="all dbcache expire-cache metadata packages" __dnf_module_subcmds="install remove update enable disable reset provides list info repoquery" __dnf_repoquery_subcmds=" -a -f -i -l -s --all --arch --archlist --available --alldeps --conflicts --deplist --duplicates --exactdeps --extras --envra --enhances --file --groupmember --installed --installonly --info --latest-limit --list --location --nevra --nvr --provides --qf --queryformat --querytags --recent --requires-pre --recommends --requires --recursive --resolve --source --suggests --supplements --show-duplicates --srpm --tree --upgrades --unneeded --unsatisfied --userinstalled --whatconflicts --whatobsoletes --whatprovides --whatrequires --whatrecommends --whatenhances --whatsuggests --whatsupplements " __dnf_repopkgs_subcmds=" check-update info install list move-to remove-or-reinstall remove-or-distro-sync reinstall reinstall-old upgrade upgrade-to " __dnf_python_exec= _dnf_set_python_exec() { if [[ "$( readlink /usr/bin/dnf )" == "dnf-2" ]]; then __dnf_python_exec="/usr/bin/python2" else if [ -x /usr/libexec/platform-python ]; then __dnf_python_exec="/usr/libexec/platform-python" else __dnf_python_exec="/usr/bin/python3" fi fi } _dnf_commands_helper() { local helper_cmd="import sys; from dnf.cli import completion_helper as ch; ch.main(sys.argv[1:])" local helper_opts="-d 0 -q -C --assumeno --nogpgcheck" echo "$( ${__dnf_python_exec} -c "$helper_cmd" "$@" $helper_opts 2>/dev/null . __contains_word () { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done } __get_interfaces(){ { cd /sys/class/net && echo *; } | \ while read -d' ' -r name; do [[ "$name" != "lo" ]] && echo "$name" done } _systemd-resolve() { local i comps local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local -A OPTS=( [STANDALONE]='-h --help --version --no-pager -4 -6 --service --openpgp --tlsa --status --statistics --reset-statistics --service-address=no --service-txt=no --cname=no --search=no --legend=no --flush-caches --reset-server-features --revert' [ARG]='-i --interface -p --protocol -t --type -c --class --raw --set-dns --set-domain --set-llmnr --set-mdns --set-dnssec --set-nta' ) if __contains_word "$prev" ${OPTS[ARG]}; then case $prev in --interface|-i) comps=$( __get_interfaces ) ;; --protocol|-p|--type|-t|--class|-c) comps=$( systemd-resolve --legend=no "$prev" help; echo help ) ;; --raw) comps="payload packet" ;; --set-dns|--set-domain|--set-nta) comps="" ;; --set-llmnr|--set-mdns) comps="yes no resolve" ;; --set-dnssec) comps="yes no allow-downgrade" ;; --set-dnsovertls) comps="no opportunistic" ;; esac COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) return 0 fi if [[ "$cur" = -* ]]; then COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) return 0 fi } complete -F _systemd-resolve systemd-resolve completions/fsck.minix000064400000000577152525375750011125 0ustar00_fsck.minix_module() { local cur OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" case $cur in -*) OPTS="--list --auto --repair --verbose --super --uncleared --force --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) ) return 0 } complete -F _fsck.minix_module fsck.minix completions/mountpoint000064400000000747152525375750011267 0ustar00_mountpoint_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--quiet --fs-devno --devno --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- ${cur:-"/"}) ) return 0 } complete -F _mountpoint_module mountpoint completions/sfdisk000064400000003734152525375750010335 0ustar00_sfdisk_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-d'|'--dump'|'-J'|'--json'|'-l'|'--list'|'-F'|'--list-free'|'-r'|'--reorder'|'-s'|'--show-size'|'-V'|'--verify'|'-A'|'--activate'|'--delete') COMPREPLY=( $(compgen -W "$(lsblk -dpnro name)" -- $cur) ) return 0 ;; '-N'|'--partno') COMPREPLY=( $(compgen -W "number" -- $cur) ) return 0 ;; '--color'|'-w'|'--wipe'|'-W'|'--wipe-partitions') COMPREPLY=( $(compgen -W "auto never always" -- $cur) ) return 0 ;; '-o'|'--output') local prefix realcur OUTPUT_ALL OUTPUT realcur="${cur##*,}" prefix="${cur%$realcur}" OUTPUT_ALL=" Attrs Boot Bsize Cpg Cylinders Device End End-C/H/S Flags Fsize Id Name Sectors Size Slice Start Start-C/H/S Type Type-UUID UUID " for WORD in $OUTPUT_ALL; do if ! [[ $prefix == *"$WORD"* ]]; then OUTPUT="$WORD ${OUTPUT:-""}" fi done compopt -o nospace COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- "$realcur") ) return 0 ;; '-O'|'--backup-file') local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 ;; '-h'|'--help'|'-v'|'--version') return 0 ;; esac case $cur in '=') cur=${cur#=} ;; -*) OPTS=" --activate --dump --json --show-geometry --list --list-free --reorder --show-size --list-types --verify --delete --part-label --part-type --part-uuid --part-attrs --append --backup --bytes --move-data --force --color --partno --no-act --no-reread --no-tell-kernel --backup-file --output --quiet --wipe --wipe-partitions --label --label-nested --help --version " COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) ) return 0 } complete -F _sfdisk_module sfdisk completions/cpupower000064400000006657152525375750010725 0ustar00# -*- shell-script -*- # bash completion script for cpupower # Taken from git.git's completion script. _cpupower_commands="frequency-info frequency-set idle-info idle-set set info monitor" _frequency_info () { local flags="-f -w -l -d -p -g -a -s -y -o -m -n --freq --hwfreq --hwlimits --driver --policy --governors --related-cpus --affected-cpus --stats --latency --proc --human --no-rounding" local prev="${COMP_WORDS[COMP_CWORD-1]}" local cur="${COMP_WORDS[COMP_CWORD]}" case "$prev" in frequency-info) COMPREPLY=($(compgen -W "$flags" -- "$cur")) ;; esac } _frequency_set () { local flags="-f -g --freq --governor -d --min -u --max -r --related" local prev="${COMP_WORDS[COMP_CWORD-1]}" local cur="${COMP_WORDS[COMP_CWORD]}" case "$prev" in -f| --freq | -d | --min | -u | --max) if [ -d /sys/devices/system/cpu/cpufreq/ ] ; then COMPREPLY=($(compgen -W '$(cat $(ls -d /sys/devices/system/cpu/cpufreq/policy* | head -1)/scaling_available_frequencies)' -- "$cur")) fi ;; -g| --governor) if [ -d /sys/devices/system/cpu/cpufreq/ ] ; then COMPREPLY=($(compgen -W '$(cat $(ls -d /sys/devices/system/cpu/cpufreq/policy* | head -1)/scaling_available_governors)' -- "$cur")) fi;; frequency-set) COMPREPLY=($(compgen -W "$flags" -- "$cur")) ;; esac } _idle_info() { local flags="-f --silent" local prev="${COMP_WORDS[COMP_CWORD-1]}" local cur="${COMP_WORDS[COMP_CWORD]}" case "$prev" in idle-info) COMPREPLY=($(compgen -W "$flags" -- "$cur")) ;; esac } _idle_set() { local flags="-d --disable -e --enable -D --disable-by-latency -E --enable-all" local prev="${COMP_WORDS[COMP_CWORD-1]}" local cur="${COMP_WORDS[COMP_CWORD]}" case "$prev" in idle-set) COMPREPLY=($(compgen -W "$flags" -- "$cur")) ;; esac } _set() { local flags="--perf-bias, -b" local prev="${COMP_WORDS[COMP_CWORD-1]}" local cur="${COMP_WORDS[COMP_CWORD]}" case "$prev" in set) COMPREPLY=($(compgen -W "$flags" -- "$cur")) ;; esac } _monitor() { local flags="-l -m -i -c -v" local prev="${COMP_WORDS[COMP_CWORD-1]}" local cur="${COMP_WORDS[COMP_CWORD]}" case "$prev" in monitor) COMPREPLY=($(compgen -W "$flags" -- "$cur")) ;; esac } _taskset() { local prev_to_prev="${COMP_WORDS[COMP_CWORD-2]}" local prev="${COMP_WORDS[COMP_CWORD-1]}" local cur="${COMP_WORDS[COMP_CWORD]}" case "$prev_to_prev" in -c|--cpu) COMPREPLY=($(compgen -W "$_cpupower_commands" -- "$cur")) ;; esac case "$prev" in frequency-info) _frequency_info ;; frequency-set) _frequency_set ;; idle-info) _idle_info ;; idle-set) _idle_set ;; set) _set ;; monitor) _monitor ;; esac } _cpupower () { local i local c=1 local command while test $c -lt $COMP_CWORD; do if test $c == 1; then command="${COMP_WORDS[c]}" fi c=$((++c)) done # Complete name of subcommand if the user has not finished typing it yet. if test $c -eq $COMP_CWORD -a -z "$command"; then COMPREPLY=($(compgen -W "help -v --version -c --cpu $_cpupower_commands" -- "${COMP_WORDS[COMP_CWORD]}")) return fi # Complete arguments to subcommands. case "$command" in -v|--version) return ;; -c|--cpu) _taskset ;; help) COMPREPLY=($(compgen -W "$_cpupower_commands" -- "${COMP_WORDS[COMP_CWORD]}")) ;; frequency-info) _frequency_info ;; frequency-set) _frequency_set ;; idle-info) _idle_info ;; idle-set) _idle_set ;; set) _set ;; monitor) _monitor ;; esac } complete -o bashdefault -o default -F _cpupower cpupower 2>/dev/null \ || complete -o default -F _cpupower cpupower completions/setterm000064400000005037152525375750010533 0ustar00_setterm_module() { local bright cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '--term') local TERM_LIST I TERM_LIST='' for I in /usr/share/terminfo/?/*; do TERM_LIST+="${I##*/} " done COMPREPLY=( $(compgen -W "$TERM_LIST" -- $cur) ) return 0 ;; '--foreground'|'--background') COMPREPLY=( $(compgen -W "black blue cyan default green magenta red white yellow" -- $cur) ) return 0 ;; '--ulcolor'|'--hbcolor'|'bright') if [ $prev != 'bright' ]; then bright='bright black grey' else bright='' fi COMPREPLY=( $(compgen -W "$bright blue cyan green magenta red white yellow" -- $cur) ) return 0 ;; '--cursor'|'--repeat'|'--appcursorkeys'|'--linewrap'|'--inversescreen'|'--bold'|'--half-bright'|'--blink'|'--reverse'|'--underline'|'--msg') COMPREPLY=( $(compgen -W "off on" -- $cur) ) return 0 ;; '--clear') COMPREPLY=( $(compgen -W "all rest" -- $cur) ) return 0 ;; '--tabs'|'--clrtabs') COMPREPLY=( $(compgen -W "tab1 tab2 tab3 tab160" -- $cur) ) return 0 ;; '--regtabs') COMPREPLY=( $(compgen -W "{1..160}" -- $cur) ) return 0 ;; '--blank') COMPREPLY=( $(compgen -W "{0..60} force poke" -- $cur) ) return 0 ;; '--dump'|'--append') local NUM_CONS NUM_CONS=(/dev/vcsa?*) COMPREPLY=( $(compgen -W "{1..${#NUM_CONS[*]}}" -- $cur) ) return 0 ;; '--file') local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 ;; '--msglevel') COMPREPLY=( $(compgen -W "{0..8}" -- $cur) ) return 0 ;; '--powersave') COMPREPLY=( $(compgen -W "on vsync hsync powerdown off" -- $cur) ) return 0 ;; '--powerdown') COMPREPLY=( $(compgen -W "{0..60}" -- $cur) ) return 0 ;; '--blength') COMPREPLY=( $(compgen -W "0-2000" -- $cur) ) return 0 ;; '--bfreq') COMPREPLY=( $(compgen -W "freqnumber" -- $cur) ) return 0 ;; '--help'|'--version') return 0 ;; esac OPTS=" --term --reset --resize --initialize --cursor --repeat --appcursorkeys --linewrap --default --foreground --background --ulcolor --hbcolor --ulcolor --hbcolor --inversescreen --bold --half-bright --blink --reverse --underline --store --clear --tabs --clrtabs --regtabs --blank --dump --append --file --msg --msglevel --powersave --powerdown --blength --bfreq --version --help" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 } complete -F _setterm_module setterm completions/stunnel.bash000064400000001071152525375750011446 0ustar00# bash completion for stunnel -*- shell-script -*- # by Michal Trojnara 1998-2023 _comp_cmd_stunnel() { local cur prev words cword _init_completion || return local opt="-fd -help -version -sockets -options" case $prev in -fd | -help | -version | -sockets | -options) return ;; esac if [[ ${cur} == -* ]] ; then COMPREPLY=($(compgen -W "${opt}" -- ${cur})) return fi _filedir '@(cnf|conf)' } && complete -F _comp_cmd_stunnel stunnel # ex: filetype=sh completions/utmpdump000064400000000733152525375750010721 0ustar00_utmpdump_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--follow --reverse --output --version --help" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _utmpdump_module utmpdump completions/setsebool000064400000003430152525375750011042 0ustar00# This file is part of systemd. # # Copyright 2011 Dan Walsh # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with systemd; If not, see . __contains_word () { local word=$1; shift for w in $*; do [[ $w = $word ]] && return 0; done return 1 } __get_all_booleans () { getsebool -a | cut -f1 -d' ' } _setsebool () { local command=${COMP_WORDS[1]} local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local verb comps if [ "$verb" = "" -a "$prev" = "setsebool" -o "$prev" = "-P" ]; then COMPREPLY=( $(compgen -W "-P $( __get_all_booleans ) " -- "$cur") ) return 0 fi COMPREPLY=( $(compgen -W "0 1 -P" -- "$cur") ) return 0 } _getsebool () { local command=${COMP_WORDS[1]} local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local verb comps if [ "$verb" = "" -a "$prev" == "getsebool" ]; then COMPREPLY=( $(compgen -W "-a $( __get_all_booleans ) " -- "$cur") ) return 0 fi if [ "$verb" = "" -a "$prev" != "-a" ]; then COMPREPLY=( $(compgen -W "$( __get_all_booleans ) " -- "$cur") ) return 0 fi return 0 } complete -F _setsebool setsebool complete -F _getsebool getsebool completions/systemd-detect-virt000064400000002521152525375750012763 0ustar00# systemd-detect-virt(1) completion -*- shell-script -*- # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . __contains_word() { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done } _systemd_detect_virt() { local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local i verb comps local -A OPTS=( [STANDALONE]='-h --help --version -c --container -v --vm -q --quiet --private-users' ) _init_completion || return COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) } complete -F _systemd_detect_virt systemd-detect-virt completions/more000064400000001020152525375750007776 0ustar00_more_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-V') return 0 ;; esac case $cur in -*) OPTS="-d -f -l -p -c -u -s -number -V" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; +*) OPTS="+number +/string" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _more_module more completions/column000064400000001325152525375750010341 0ustar00_column_module() { local cur prev OPTS COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in '-c'|'--columns') COMPREPLY=( $(compgen -W "number" -- $cur) ) return 0 ;; '-s'|'--separator'|'-o'|'--output-separator') COMPREPLY=( $(compgen -W "string" -- $cur) ) return 0 ;; '-h'|'--help'|'-V'|'--version') return 0 ;; esac case $cur in -*) OPTS="--columns --table --separator --output-separator --fillrows --help --version" COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) return 0 ;; esac local IFS=$'\n' compopt -o filenames COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _column_module column completions/gapplication000064400000002555152525375750011524 0ustar00 # Check for bash [ -z "$BASH_VERSION" ] && return #################################################################################################### __app() { case "${COMP_CWORD}" in 1) COMPREPLY=($(compgen -W "help version list-apps launch action list-actions" -- "${COMP_WORDS[1]}")) return 0 ;; 2) case "${COMP_WORDS[1]}" in launch|action|list-actions) COMPREPLY=($(compgen -W "`gapplication list-apps`" -- "${COMP_WORDS[2]}")) return 0 ;; *) COMPREPLY=() return 0 ;; esac ;; esac # Otherwise, what we will do is based on the command in ${COMP_WORDS[1]} case "${COMP_WORDS[1]}" in action) # Word 3 is the action name. This is the only one we can help with. if [ "${COMP_CWORD}" == 3 ]; then COMPREPLY=($(compgen -W "`gapplication list-actions "${COMP_WORDS[2]}"`" -- "${COMP_WORDS[3]}")) return 0 else COMPREPLY=() return 0 fi ;; launch) # Filenames... COMPREPLY=($(compgen -A file "${COMP_WORDS[COMP_CWORD]}")) return 0 ;; *) # Nothing else should be out this far... COMPREPLY=() return 0 esac } #################################################################################################### complete -F __app gapplication completions/augtool000064400000001234152535352750010511 0ustar00# bash completion for augtool -*- shell-script -*- _augtool() { local cur prev words cword _init_completion || return case $prev in --help | --version | -!(-*)[hV]) return ;; --load-file | --file | -!(-*)[lf]) _filedir return ;; --root | --include | -!(-*)[rI]) _filedir -d return ;; esac if [[ "$cur" == -* ]]; then local opts="$(_parse_help "$1")" COMPREPLY=($(compgen -W '${opts:-$(_parse_help "$1")}' -- "$cur")) fi } && complete -F _augtool augtool # ex: filetype=sh completions/augmatch000064400000001456152535352750010636 0ustar00# bash completion for augtool -*- shell-script -*- _augmatch() { local cur prev words cword _init_completion || return case $prev in --help | -!(-*)[h]) return ;; --lens | -!(-*)[l]) local lenses lenses="$(augtool --noload 'match /augeas/load/*/lens' | sed -e 's/.*@//')" COMPREPLY=($(compgen -W "${lenses,,}" -- "${cur,,}")) return ;; --root | --include | -!(-*)[rI]) _filedir -d return ;; esac if [[ "$cur" == -* ]]; then local opts="$(_parse_help "$1")" COMPREPLY=($(compgen -W '${opts:-$(_parse_help "$1")}' -- "$cur")) else _filedir fi } && complete -F _augmatch augmatch # ex: filetype=sh completions/augprint000064400000001455152535352750010675 0ustar00# bash completion for augtool -*- shell-script -*- _augprint() { local cur prev words cword _init_completion || return case $prev in --help | --version | -!(-*)[hV]) return ;; --target | -!(-*)[t]) _filedir return ;; --lens | -!(-*)[l]) local lenses lenses="$(augtool --noload 'match /augeas/load/*/lens' | sed -e 's/.*@//')" COMPREPLY=($(compgen -W "${lenses,,}" -- "${cur,,}")) return ;; esac if [[ "$cur" == -* ]]; then local opts="$(_parse_help "$1")" COMPREPLY=($(compgen -W '${opts:-$(_parse_help "$1")}' -- "$cur")) else _filedir fi } && complete -F _augprint augprint # ex: filetype=sh