Adding upstream version 2.41.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
This commit is contained in:
parent
9586bb3c92
commit
c36e531662
3661 changed files with 2164106 additions and 0 deletions
363
bash-completion/Makemodule.am
Normal file
363
bash-completion/Makemodule.am
Normal file
|
@ -0,0 +1,363 @@
|
|||
if BUILD_BASH_COMPLETION
|
||||
|
||||
if BUILD_BLKID
|
||||
dist_bashcompletion_DATA += bash-completion/blkid
|
||||
endif
|
||||
if BUILD_CAL
|
||||
dist_bashcompletion_DATA += bash-completion/cal
|
||||
endif
|
||||
if BUILD_COL
|
||||
dist_bashcompletion_DATA += bash-completion/col
|
||||
endif
|
||||
if BUILD_COLCRT
|
||||
dist_bashcompletion_DATA += bash-completion/colcrt
|
||||
endif
|
||||
if BUILD_COLRM
|
||||
dist_bashcompletion_DATA += bash-completion/colrm
|
||||
endif
|
||||
if BUILD_COLUMN
|
||||
dist_bashcompletion_DATA += bash-completion/column
|
||||
endif
|
||||
if BUILD_EXCH
|
||||
dist_bashcompletion_DATA += bash-completion/exch
|
||||
endif
|
||||
if BUILD_FINCORE
|
||||
dist_bashcompletion_DATA += bash-completion/fincore
|
||||
endif
|
||||
if BUILD_FINDFS
|
||||
dist_bashcompletion_DATA += bash-completion/findfs
|
||||
endif
|
||||
if BUILD_FINDMNT
|
||||
dist_bashcompletion_DATA += bash-completion/findmnt
|
||||
endif
|
||||
if BUILD_FLOCK
|
||||
dist_bashcompletion_DATA += bash-completion/flock
|
||||
endif
|
||||
if BUILD_GETOPT
|
||||
dist_bashcompletion_DATA += bash-completion/getopt
|
||||
endif
|
||||
if BUILD_HEXDUMP
|
||||
dist_bashcompletion_DATA += bash-completion/hexdump
|
||||
endif
|
||||
if BUILD_IPCMK
|
||||
dist_bashcompletion_DATA += bash-completion/ipcmk
|
||||
endif
|
||||
if BUILD_IPCRM
|
||||
dist_bashcompletion_DATA += bash-completion/ipcrm
|
||||
endif
|
||||
if BUILD_IPCS
|
||||
dist_bashcompletion_DATA += bash-completion/ipcs
|
||||
endif
|
||||
if BUILD_IRQTOP
|
||||
dist_bashcompletion_DATA += bash-completion/irqtop
|
||||
endif
|
||||
if BUILD_ISOSIZE
|
||||
dist_bashcompletion_DATA += bash-completion/isosize
|
||||
endif
|
||||
if BUILD_LOGGER
|
||||
dist_bashcompletion_DATA += bash-completion/logger
|
||||
endif
|
||||
if BUILD_LOOK
|
||||
dist_bashcompletion_DATA += bash-completion/look
|
||||
endif
|
||||
if BUILD_LSIPC
|
||||
dist_bashcompletion_DATA += bash-completion/lsipc
|
||||
endif
|
||||
if BUILD_LSIRQ
|
||||
dist_bashcompletion_DATA += bash-completion/lsirq
|
||||
endif
|
||||
if BUILD_LSNS
|
||||
dist_bashcompletion_DATA += bash-completion/lsns
|
||||
endif
|
||||
if BUILD_MCOOKIE
|
||||
dist_bashcompletion_DATA += bash-completion/mcookie
|
||||
endif
|
||||
if BUILD_MKFS
|
||||
dist_bashcompletion_DATA += bash-completion/mkfs
|
||||
endif
|
||||
if BUILD_MKSWAP
|
||||
dist_bashcompletion_DATA += bash-completion/mkswap
|
||||
endif
|
||||
if BUILD_NAMEI
|
||||
dist_bashcompletion_DATA += bash-completion/namei
|
||||
endif
|
||||
if BUILD_PRLIMIT
|
||||
dist_bashcompletion_DATA += bash-completion/prlimit
|
||||
endif
|
||||
if BUILD_READPROFILE
|
||||
dist_bashcompletion_DATA += bash-completion/readprofile
|
||||
endif
|
||||
if BUILD_RENICE
|
||||
dist_bashcompletion_DATA += bash-completion/renice
|
||||
endif
|
||||
if BUILD_REV
|
||||
dist_bashcompletion_DATA += bash-completion/rev
|
||||
endif
|
||||
if BUILD_SCRIPT
|
||||
dist_bashcompletion_DATA += bash-completion/script
|
||||
endif
|
||||
if BUILD_SCRIPTREPLAY
|
||||
dist_bashcompletion_DATA += bash-completion/scriptreplay
|
||||
endif
|
||||
if BUILD_SCRIPTLIVE
|
||||
dist_bashcompletion_DATA += bash-completion/scriptlive
|
||||
endif
|
||||
if BUILD_SETPGID
|
||||
dist_bashcompletion_DATA += bash-completion/setpgid
|
||||
endif
|
||||
if BUILD_SETSID
|
||||
dist_bashcompletion_DATA += bash-completion/setsid
|
||||
endif
|
||||
if BUILD_WHEREIS
|
||||
dist_bashcompletion_DATA += bash-completion/whereis
|
||||
endif
|
||||
if BUILD_WIPEFS
|
||||
dist_bashcompletion_DATA += bash-completion/wipefs
|
||||
endif
|
||||
if BUILD_FSCK
|
||||
dist_bashcompletion_DATA += bash-completion/fsck
|
||||
endif
|
||||
|
||||
if BUILD_BFS
|
||||
dist_bashcompletion_DATA += bash-completion/mkfs.bfs
|
||||
endif
|
||||
|
||||
if BUILD_MINIX
|
||||
dist_bashcompletion_DATA += \
|
||||
bash-completion/fsck.minix \
|
||||
bash-completion/mkfs.minix
|
||||
endif
|
||||
|
||||
if BUILD_CRAMFS
|
||||
dist_bashcompletion_DATA += \
|
||||
bash-completion/fsck.cramfs \
|
||||
bash-completion/mkfs.cramfs
|
||||
endif
|
||||
if BUILD_PARTX
|
||||
dist_bashcompletion_DATA += \
|
||||
bash-completion/addpart \
|
||||
bash-completion/delpart \
|
||||
bash-completion/resizepart \
|
||||
bash-completion/partx
|
||||
endif
|
||||
if BUILD_RAW
|
||||
dist_bashcompletion_DATA += bash-completion/raw
|
||||
endif
|
||||
if BUILD_SWAPLABEL
|
||||
dist_bashcompletion_DATA += bash-completion/swaplabel
|
||||
endif
|
||||
if BUILD_FDFORMAT
|
||||
dist_bashcompletion_DATA += bash-completion/fdformat
|
||||
endif
|
||||
if BUILD_BLOCKDEV
|
||||
dist_bashcompletion_DATA += bash-completion/blockdev
|
||||
endif
|
||||
|
||||
if BUILD_FDISK
|
||||
dist_bashcompletion_DATA += bash-completion/fdisk
|
||||
endif
|
||||
if BUILD_SFDISK
|
||||
dist_bashcompletion_DATA += bash-completion/sfdisk
|
||||
endif
|
||||
if BUILD_CFDISK
|
||||
dist_bashcompletion_DATA += bash-completion/cfdisk
|
||||
endif
|
||||
|
||||
if BUILD_CHFN_CHSH
|
||||
dist_bashcompletion_DATA += \
|
||||
bash-completion/chfn \
|
||||
bash-completion/chsh
|
||||
endif
|
||||
if BUILD_LAST
|
||||
dist_bashcompletion_DATA += bash-completion/last
|
||||
install-data-hook-bashcomp-lastb::
|
||||
ln -sf last $(DESTDIR)$(bashcompletiondir)/lastb
|
||||
INSTALL_DATA_HOOKS += install-data-hook-bashcomp-lastb
|
||||
endif
|
||||
if BUILD_LSLOGINS
|
||||
dist_bashcompletion_DATA += bash-completion/lslogins
|
||||
endif
|
||||
if BUILD_NEWGRP
|
||||
dist_bashcompletion_DATA += bash-completion/newgrp
|
||||
endif
|
||||
|
||||
if BUILD_SU
|
||||
dist_bashcompletion_DATA += bash-completion/su
|
||||
endif
|
||||
|
||||
if BUILD_RUNUSER
|
||||
install-data-hook-bashcomp-runuser::
|
||||
if BUILD_SU
|
||||
ln -sf su $(DESTDIR)$(bashcompletiondir)/runuser
|
||||
else
|
||||
cp $(top_srcdir)/bash-completion/su $(DESTDIR)$(bashcompletiondir)/runuser
|
||||
endif
|
||||
INSTALL_DATA_HOOKS += install-data-hook-bashcomp-runuser
|
||||
endif
|
||||
|
||||
if BUILD_UTMPDUMP
|
||||
dist_bashcompletion_DATA += bash-completion/utmpdump
|
||||
endif
|
||||
if BUILD_UUIDGEN
|
||||
dist_bashcompletion_DATA += bash-completion/uuidgen
|
||||
endif
|
||||
if BUILD_LIBLASTLOG2
|
||||
dist_bashcompletion_DATA += bash-completion/lastlog2
|
||||
endif
|
||||
if BUILD_UUIDPARSE
|
||||
dist_bashcompletion_DATA += bash-completion/uuidparse
|
||||
endif
|
||||
if BUILD_UUIDD
|
||||
dist_bashcompletion_DATA += bash-completion/uuidd
|
||||
endif
|
||||
if BUILD_LSBLK
|
||||
dist_bashcompletion_DATA += bash-completion/lsblk
|
||||
endif
|
||||
if BUILD_LSLOCKS
|
||||
dist_bashcompletion_DATA += bash-completion/lslocks
|
||||
endif
|
||||
if BUILD_RENAME
|
||||
dist_bashcompletion_DATA += bash-completion/rename
|
||||
endif
|
||||
if BUILD_CHRT
|
||||
dist_bashcompletion_DATA += bash-completion/chrt
|
||||
endif
|
||||
if BUILD_UCLAMPSET
|
||||
dist_bashcompletion_DATA += bash-completion/uclampset
|
||||
endif
|
||||
if BUILD_IONICE
|
||||
dist_bashcompletion_DATA += bash-completion/ionice
|
||||
endif
|
||||
if BUILD_TASKSET
|
||||
dist_bashcompletion_DATA += bash-completion/taskset
|
||||
endif
|
||||
|
||||
if BUILD_CHCPU
|
||||
dist_bashcompletion_DATA += bash-completion/chcpu
|
||||
endif
|
||||
if BUILD_CHMEM
|
||||
dist_bashcompletion_DATA += bash-completion/chmem
|
||||
endif
|
||||
if BUILD_EJECT
|
||||
dist_bashcompletion_DATA += bash-completion/eject
|
||||
endif
|
||||
if BUILD_FALLOCATE
|
||||
dist_bashcompletion_DATA += bash-completion/fallocate
|
||||
endif
|
||||
if BUILD_HWCLOCK
|
||||
dist_bashcompletion_DATA += bash-completion/hwclock
|
||||
endif
|
||||
if BUILD_TUNELP
|
||||
dist_bashcompletion_DATA += bash-completion/tunelp
|
||||
endif
|
||||
if BUILD_LSCPU
|
||||
dist_bashcompletion_DATA += bash-completion/lscpu
|
||||
endif
|
||||
if BUILD_LSMEM
|
||||
dist_bashcompletion_DATA += bash-completion/lsmem
|
||||
endif
|
||||
if BUILD_LOSETUP
|
||||
dist_bashcompletion_DATA += bash-completion/losetup
|
||||
endif
|
||||
if BUILD_MOUNT
|
||||
dist_bashcompletion_DATA += bash-completion/mount
|
||||
dist_bashcompletion_DATA += bash-completion/umount
|
||||
endif
|
||||
if BUILD_MOUNTPOINT
|
||||
dist_bashcompletion_DATA += bash-completion/mountpoint
|
||||
endif
|
||||
if BUILD_NSENTER
|
||||
dist_bashcompletion_DATA += bash-completion/nsenter
|
||||
endif
|
||||
if BUILD_PIVOT_ROOT
|
||||
dist_bashcompletion_DATA += bash-completion/pivot_root
|
||||
endif
|
||||
if BUILD_SETPRIV
|
||||
dist_bashcompletion_DATA += bash-completion/setpriv
|
||||
endif
|
||||
if BUILD_SWAPON
|
||||
dist_bashcompletion_DATA += bash-completion/swapon
|
||||
dist_bashcompletion_DATA += bash-completion/swapoff
|
||||
endif
|
||||
if BUILD_UNSHARE
|
||||
dist_bashcompletion_DATA += bash-completion/unshare
|
||||
endif
|
||||
if BUILD_WDCTL
|
||||
dist_bashcompletion_DATA += bash-completion/wdctl
|
||||
endif
|
||||
if BUILD_BLKDISCARD
|
||||
dist_bashcompletion_DATA += bash-completion/blkdiscard
|
||||
endif
|
||||
if BUILD_BLKZONE
|
||||
dist_bashcompletion_DATA += bash-completion/blkzone
|
||||
endif
|
||||
if BUILD_CTRLALTDEL
|
||||
dist_bashcompletion_DATA += bash-completion/ctrlaltdel
|
||||
endif
|
||||
if BUILD_DMESG
|
||||
dist_bashcompletion_DATA += bash-completion/dmesg
|
||||
endif
|
||||
if BUILD_FSFREEZE
|
||||
dist_bashcompletion_DATA += bash-completion/fsfreeze
|
||||
endif
|
||||
if BUILD_FSTRIM
|
||||
dist_bashcompletion_DATA += bash-completion/fstrim
|
||||
endif
|
||||
if BUILD_LDATTACH
|
||||
dist_bashcompletion_DATA += bash-completion/ldattach
|
||||
endif
|
||||
if BUILD_RFKILL
|
||||
dist_bashcompletion_DATA += bash-completion/rfkill
|
||||
endif
|
||||
if BUILD_RTCWAKE
|
||||
dist_bashcompletion_DATA += bash-completion/rtcwake
|
||||
endif
|
||||
if BUILD_SETARCH
|
||||
dist_bashcompletion_DATA += bash-completion/setarch
|
||||
endif
|
||||
if BUILD_ZRAMCTL
|
||||
dist_bashcompletion_DATA += bash-completion/zramctl
|
||||
endif
|
||||
|
||||
if BUILD_MESG
|
||||
dist_bashcompletion_DATA += bash-completion/mesg
|
||||
endif
|
||||
if BUILD_WALL
|
||||
dist_bashcompletion_DATA += bash-completion/wall
|
||||
endif
|
||||
if BUILD_WRITE
|
||||
dist_bashcompletion_DATA += bash-completion/write
|
||||
endif
|
||||
if BUILD_SETTERM
|
||||
dist_bashcompletion_DATA += bash-completion/setterm
|
||||
endif
|
||||
|
||||
if BUILD_MORE
|
||||
dist_bashcompletion_DATA += bash-completion/more
|
||||
endif
|
||||
if BUILD_PG
|
||||
dist_bashcompletion_DATA += bash-completion/pg
|
||||
endif
|
||||
if BUILD_UL
|
||||
dist_bashcompletion_DATA += bash-completion/ul
|
||||
endif
|
||||
if BUILD_HARDLINK
|
||||
dist_bashcompletion_DATA += bash-completion/hardlink
|
||||
endif
|
||||
if BUILD_PIPESZ
|
||||
dist_bashcompletion_DATA += bash-completion/pipesz
|
||||
endif
|
||||
if BUILD_FADVISE
|
||||
dist_bashcompletion_DATA += bash-completion/fadvise
|
||||
endif
|
||||
if BUILD_WAITPID
|
||||
dist_bashcompletion_DATA += bash-completion/waitpid
|
||||
endif
|
||||
if BUILD_ENOSYS
|
||||
dist_bashcompletion_DATA += bash-completion/enosys
|
||||
endif
|
||||
if BUILD_LSCLOCKS
|
||||
dist_bashcompletion_DATA += bash-completion/lsclocks
|
||||
endif
|
||||
|
||||
endif # BUILD_BASH_COMPLETION
|
24
bash-completion/addpart
Normal file
24
bash-completion/addpart
Normal file
|
@ -0,0 +1,24 @@
|
|||
_addpart_module()
|
||||
{
|
||||
local cur
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
case $COMP_CWORD in
|
||||
1)
|
||||
OPTS="--help --version $(lsblk -pnro name)"
|
||||
compopt -o bashdefault -o default
|
||||
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
|
38
bash-completion/blkdiscard
Normal file
38
bash-completion/blkdiscard
Normal file
|
@ -0,0 +1,38 @@
|
|||
_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="
|
||||
--force
|
||||
--offset
|
||||
--length
|
||||
--quiet
|
||||
--step
|
||||
--secure
|
||||
--zeroout
|
||||
--verbose
|
||||
--help
|
||||
--version
|
||||
"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
compopt -o bashdefault -o default
|
||||
COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _blkdiscard_module blkdiscard
|
100
bash-completion/blkid
Normal file
100
bash-completion/blkid
Normal file
|
@ -0,0 +1,100 @@
|
|||
_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 json" -- $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
|
||||
--no-part-details
|
||||
--help
|
||||
--version
|
||||
"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
compopt -o bashdefault -o default
|
||||
COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _blkid_module blkid
|
53
bash-completion/blkzone
Normal file
53
bash-completion/blkzone
Normal file
|
@ -0,0 +1,53 @@
|
|||
_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 --force"
|
||||
;;
|
||||
*)
|
||||
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
|
||||
compopt -o bashdefault -o default
|
||||
COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _blkzone_module blkzone
|
47
bash-completion/blockdev
Normal file
47
bash-completion/blockdev
Normal file
|
@ -0,0 +1,47 @@
|
|||
_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
|
||||
--getdiskseq
|
||||
--getzonesz
|
||||
--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
|
||||
;;
|
||||
'--setra'|'--setfra')
|
||||
COMPREPLY=( $(compgen -W "sectors" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
compopt -o bashdefault -o default
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _blockdev_module blockdev
|
30
bash-completion/cal
Normal file
30
bash-completion/cal
Normal file
|
@ -0,0 +1,30 @@
|
|||
_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
|
||||
--vertical
|
||||
--version
|
||||
--help"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
complete -F _cal_module cal
|
32
bash-completion/cfdisk
Normal file
32
bash-completion/cfdisk
Normal file
|
@ -0,0 +1,32 @@
|
|||
_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
|
||||
--lock
|
||||
--help
|
||||
--read-only
|
||||
--version"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
compopt -o bashdefault -o default
|
||||
COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _cfdisk_module cfdisk
|
59
bash-completion/chcpu
Normal file
59
bash-completion/chcpu
Normal file
|
@ -0,0 +1,59 @@
|
|||
_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
|
22
bash-completion/chfn
Normal file
22
bash-completion/chfn
Normal file
|
@ -0,0 +1,22 @@
|
|||
_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
|
30
bash-completion/chmem
Normal file
30
bash-completion/chmem
Normal file
|
@ -0,0 +1,30 @@
|
|||
_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
|
52
bash-completion/chrt
Normal file
52
bash-completion/chrt
Normal file
|
@ -0,0 +1,52 @@
|
|||
_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
|
26
bash-completion/chsh
Normal file
26
bash-completion/chsh
Normal file
|
@ -0,0 +1,26 @@
|
|||
_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
|
27
bash-completion/col
Normal file
27
bash-completion/col
Normal file
|
@ -0,0 +1,27 @@
|
|||
_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
|
27
bash-completion/colcrt
Normal file
27
bash-completion/colcrt
Normal file
|
@ -0,0 +1,27 @@
|
|||
_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
|
29
bash-completion/colrm
Normal file
29
bash-completion/colrm
Normal file
|
@ -0,0 +1,29 @@
|
|||
_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
|
65
bash-completion/column
Normal file
65
bash-completion/column
Normal file
|
@ -0,0 +1,65 @@
|
|||
_column_module()
|
||||
{
|
||||
local cur prev OPTS
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
case $prev in
|
||||
'-c'|'--output-width'|'-l'|'--table-columns-limit'|'-S'|'--use-spaces')
|
||||
COMPREPLY=( $(compgen -W "number" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-s'|'--separator'|'-o'|'--output-separator'|'-n'|'--table-name'|'-O')
|
||||
COMPREPLY=( $(compgen -W "string" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-O'|'--table-order'|'-N'|'--table-columns'|'-E'|'--table-noextreme'|'-H'|'--table-hide'|'-R'|'--table-right'|'-T'|'--table-truncate'|'-W'|'--table-wrap')
|
||||
COMPREPLY=( $(compgen -W "string" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-r'|'--tree'|'-i'|'--tree-id'|'-p'|'--tree-parent')
|
||||
COMPREPLY=( $(compgen -W "string" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-h'|'--help'|'-V'|'--version')
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
case $cur in
|
||||
-*)
|
||||
OPTS="--columns
|
||||
--table
|
||||
--table-name
|
||||
--table-order
|
||||
--table-columns
|
||||
--table-columns-limit
|
||||
--table-noextreme
|
||||
--table-noheadings
|
||||
--table-maxout
|
||||
--table-header-repeat
|
||||
--table-hide
|
||||
--table-right
|
||||
--table-truncate
|
||||
--table-wrap
|
||||
--keep-empty-lines
|
||||
--json
|
||||
--tree
|
||||
--tree-id
|
||||
--tree-parent
|
||||
--output-width
|
||||
--separator
|
||||
--output-separator
|
||||
--fillrows
|
||||
--use-spaces
|
||||
--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
|
17
bash-completion/ctrlaltdel
Normal file
17
bash-completion/ctrlaltdel
Normal file
|
@ -0,0 +1,17 @@
|
|||
_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
|
25
bash-completion/delpart
Normal file
25
bash-completion/delpart
Normal file
|
@ -0,0 +1,25 @@
|
|||
_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)"
|
||||
compopt -o bashdefault -o default
|
||||
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
|
68
bash-completion/dmesg
Normal file
68
bash-completion/dmesg
Normal file
|
@ -0,0 +1,68 @@
|
|||
|
||||
_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
|
||||
--json
|
||||
--kernel
|
||||
--color
|
||||
--level
|
||||
--console-level
|
||||
--noescape
|
||||
--nopager
|
||||
--raw
|
||||
--syslog
|
||||
--buffer-size
|
||||
--ctime
|
||||
--notime
|
||||
--time-format
|
||||
--userspace
|
||||
--follow
|
||||
--follow-new
|
||||
--decode
|
||||
--since
|
||||
--until
|
||||
--help
|
||||
--version"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _dmesg_module dmesg
|
65
bash-completion/eject
Normal file
65
bash-completion/eject
Normal file
|
@ -0,0 +1,65 @@
|
|||
_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 "$(eject --listspeed 2>/dev/null)" -- $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)"
|
||||
compopt -o bashdefault -o default
|
||||
COMPREPLY=( $(compgen -W "$DEVS" $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _eject_module eject
|
49
bash-completion/enosys
Normal file
49
bash-completion/enosys
Normal file
|
@ -0,0 +1,49 @@
|
|||
_waitpid_module()
|
||||
{
|
||||
local cur prev OPTS
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
case $prev in
|
||||
'-s'|'--syscall')
|
||||
return 0
|
||||
;;
|
||||
'-i'|'--ioctl')
|
||||
return 0
|
||||
;;
|
||||
'-l'|'--list')
|
||||
return 0
|
||||
;;
|
||||
'-m'|'--list-ioctl')
|
||||
return 0
|
||||
'-d'|'--dump')
|
||||
COMPREPLY=( $(compgen -f -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-h'|'--help'|'-V'|'--version')
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
case $cur in
|
||||
-*)
|
||||
OPTS="--syscall
|
||||
--ioctl
|
||||
--list
|
||||
--list-ioctl
|
||||
--dump
|
||||
--help
|
||||
--version"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
_pids
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
local IFS=$'\n'
|
||||
compopt -o filenames
|
||||
COMPREPLY=( $(compgen -u -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _enosys_module enosys
|
26
bash-completion/exch
Normal file
26
bash-completion/exch
Normal file
|
@ -0,0 +1,26 @@
|
|||
_exch_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'
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
local IFS=$'\n'
|
||||
compopt -o filenames
|
||||
COMPREPLY=( $(compgen -f -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _exch_module exch
|
42
bash-completion/fadvise
Normal file
42
bash-completion/fadvise
Normal file
|
@ -0,0 +1,42 @@
|
|||
_fadvise_module()
|
||||
{
|
||||
local cur prev ADVS OPTS
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
case $prev in
|
||||
'-a'|'--advice')
|
||||
ADVS='normal
|
||||
sequential
|
||||
random
|
||||
noreuse
|
||||
willneeded
|
||||
dontneed'
|
||||
COMPREPLY=( $(compgen -W "${ADVS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-o'|'--offset'|'-l'|'--length')
|
||||
COMPREPLY=( $(compgen -W "bytes" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-h'|'--help'|'-V'|'--version')
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
case $cur in
|
||||
-*)
|
||||
OPTS='--advice
|
||||
--length
|
||||
--offset
|
||||
--help
|
||||
--version'
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
local IFS=$'\n'
|
||||
compopt -o filenames
|
||||
COMPREPLY=( $(compgen -f -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _fadvise_module fadvise
|
41
bash-completion/fallocate
Normal file
41
bash-completion/fallocate
Normal file
|
@ -0,0 +1,41 @@
|
|||
_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
|
29
bash-completion/fdformat
Normal file
29
bash-completion/fdformat
Normal file
|
@ -0,0 +1,29 @@
|
|||
_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
|
101
bash-completion/fdisk
Normal file
101
bash-completion/fdisk
Normal file
|
@ -0,0 +1,101 @@
|
|||
_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
|
||||
--list-details
|
||||
--noauto-pt
|
||||
--lock
|
||||
--output
|
||||
--type
|
||||
--units
|
||||
--getsz
|
||||
--bytes
|
||||
--wipe
|
||||
--wipe-partitions
|
||||
--cylinders
|
||||
--heads
|
||||
--sectors
|
||||
--help
|
||||
--version"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
compopt -o bashdefault -o default
|
||||
COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _fdisk_module fdisk
|
47
bash-completion/fincore
Normal file
47
bash-completion/fincore
Normal file
|
@ -0,0 +1,47 @@
|
|||
_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
|
||||
--output-all
|
||||
--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
|
34
bash-completion/findfs
Normal file
34
bash-completion/findfs
Normal file
|
@ -0,0 +1,34 @@
|
|||
_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
|
149
bash-completion/findmnt
Normal file
149
bash-completion/findmnt
Normal file
|
@ -0,0 +1,149 @@
|
|||
_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
|
||||
--dfi
|
||||
--direction
|
||||
--evaluate
|
||||
--tab-file
|
||||
--first-only
|
||||
--hyperlink
|
||||
--id
|
||||
--uniq-id
|
||||
--invert
|
||||
--json
|
||||
--list
|
||||
--task
|
||||
--noheadings
|
||||
--notruncate
|
||||
--options
|
||||
--output
|
||||
--output-all
|
||||
--pairs
|
||||
--raw
|
||||
--types
|
||||
--nofsroot
|
||||
--submounts
|
||||
--source
|
||||
--target
|
||||
--mountpoint
|
||||
--help
|
||||
--tree
|
||||
--real
|
||||
--pseudo
|
||||
--list-columns
|
||||
--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
|
48
bash-completion/flock
Normal file
48
bash-completion/flock
Normal file
|
@ -0,0 +1,48 @@
|
|||
_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
|
||||
--fcntl
|
||||
--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
|
39
bash-completion/fsck
Normal file
39
bash-completion/fsck
Normal file
|
@ -0,0 +1,39 @@
|
|||
_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
|
||||
compopt -o bashdefault -o default
|
||||
COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _fsck_module fsck
|
32
bash-completion/fsck.cramfs
Normal file
32
bash-completion/fsck.cramfs
Normal file
|
@ -0,0 +1,32 @@
|
|||
_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
|
||||
compopt -o bashdefault -o default
|
||||
COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _fsck.cramfs_module fsck.cramfs
|
17
bash-completion/fsck.minix
Normal file
17
bash-completion/fsck.minix
Normal file
|
@ -0,0 +1,17 @@
|
|||
_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
|
||||
compopt -o bashdefault -o default
|
||||
COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _fsck.minix_module fsck.minix
|
24
bash-completion/fsfreeze
Normal file
24
bash-completion/fsfreeze
Normal file
|
@ -0,0 +1,24 @@
|
|||
_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
|
39
bash-completion/fstrim
Normal file
39
bash-completion/fstrim
Normal file
|
@ -0,0 +1,39 @@
|
|||
_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
|
||||
--fstab
|
||||
--listed-in
|
||||
--quiet-unsupported
|
||||
--offset
|
||||
--length
|
||||
--minimum
|
||||
--types
|
||||
--verbose
|
||||
--dry-run
|
||||
--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
|
37
bash-completion/getopt
Normal file
37
bash-completion/getopt
Normal file
|
@ -0,0 +1,37 @@
|
|||
_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
|
80
bash-completion/hardlink
Normal file
80
bash-completion/hardlink
Normal file
|
@ -0,0 +1,80 @@
|
|||
_hardlink_module()
|
||||
{
|
||||
local cur prev OPTS
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
case $prev in
|
||||
'-x'|'--exclude')
|
||||
COMPREPLY=( $(compgen -W "regex" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'--exclude-subtree')
|
||||
COMPREPLY=( $(compgen -W "regex" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-i'|'--include')
|
||||
COMPREPLY=( $(compgen -W "regex" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-s'|'--minimum-size')
|
||||
COMPREPLY=( $(compgen -W "number" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-S'|'--maximum-size')
|
||||
COMPREPLY=( $(compgen -W "number" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-b'|'--io-size')
|
||||
COMPREPLY=( $(compgen -W "number" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-r'|'--cache-size')
|
||||
COMPREPLY=( $(compgen -W "number" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-y'|'--method')
|
||||
COMPREPLY=( $(compgen -W "sha256 sha1 crc32c memcmp" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'--reflink')
|
||||
COMPREPLY=( $(compgen -W "never always auto" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-H'|'--help'|'-V'|'--version')
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
case $cur in
|
||||
-*)
|
||||
OPTS="
|
||||
--content
|
||||
--respect-dir
|
||||
--respect-name
|
||||
--maximize
|
||||
--minimize
|
||||
--mount
|
||||
--dry-run
|
||||
--ignore-owner
|
||||
--keep-oldest
|
||||
--list-duplicates
|
||||
--ignore-mode
|
||||
--quiet
|
||||
--ignore-time
|
||||
--verbose
|
||||
--respect-xattrs
|
||||
--skip-reflinks
|
||||
--zero
|
||||
--version
|
||||
--help
|
||||
"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
local IFS=$'\n'
|
||||
compopt -o filenames
|
||||
COMPREPLY=( $(compgen -d -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _hardlink_module hardlink
|
54
bash-completion/hexdump
Normal file
54
bash-completion/hexdump
Normal file
|
@ -0,0 +1,54 @@
|
|||
_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-hex
|
||||
--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
|
70
bash-completion/hwclock
Normal file
70
bash-completion/hwclock
Normal file
|
@ -0,0 +1,70 @@
|
|||
_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'|'--delay')
|
||||
COMPREPLY=( $(compgen -W "time" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'--epoch')
|
||||
COMPREPLY=( $(compgen -W "year" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'--param-get')
|
||||
COMPREPLY=( $(compgen -W "param" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'--param-set')
|
||||
COMPREPLY=( $(compgen -W "param=value" -- $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
|
||||
--delay
|
||||
--epoch
|
||||
--param-get
|
||||
--param-set
|
||||
--vl-read
|
||||
--vl-clear
|
||||
--update-drift
|
||||
--noadjfile
|
||||
--adjfile
|
||||
--test
|
||||
--debug"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
complete -F _hwclock_module hwclock
|
50
bash-completion/ionice
Normal file
50
bash-completion/ionice
Normal file
|
@ -0,0 +1,50 @@
|
|||
_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
|
38
bash-completion/ipcmk
Normal file
38
bash-completion/ipcmk
Normal file
|
@ -0,0 +1,38 @@
|
|||
_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
|
||||
;;
|
||||
'-m'|'--posix-shmem')
|
||||
COMPREPLY=( $(compgen -W "size" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-S'|'--semaphore')
|
||||
COMPREPLY=( $(compgen -W "number" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-s'|'--posix-semaphore'|'-Q'|'--queue'|'-q'|'--posix-mqueue')
|
||||
return 0
|
||||
;;
|
||||
'-p'|'--mode')
|
||||
COMPREPLY=( $(compgen -W "mode" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-n'|'--name')
|
||||
COMPREPLY=( $(compgen -W "name" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-h'|'--help'|'-V'|'--version')
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
COMPREPLY=( $(compgen -W "--shmem --posix-shmem --semaphore --posix-semaphore --queue --posix-mqueue --mode --name --help --version" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _ipcmk_module ipcmk
|
80
bash-completion/ipcrm
Normal file
80
bash-completion/ipcrm
Normal file
|
@ -0,0 +1,80 @@
|
|||
_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="$(lsipc -m --noheadings -o ID)"
|
||||
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-M'|'--shmem-key')
|
||||
KEYIDS="$(lsipc -m --noheadings -o KEY)"
|
||||
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'--posix-shmem')
|
||||
KEYIDS="$(lsipc -M --noheadings -o NAME)"
|
||||
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-q'|'--queue-id')
|
||||
KEYIDS="$(lsipc -q --noheadings -o ID)"
|
||||
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-Q'|'--queue-key')
|
||||
KEYIDS="$(lsipc -q --noheadings -o KEY)"
|
||||
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'--posix-mqueue')
|
||||
KEYIDS="$(lsipc -Q --noheadings -o NAME)"
|
||||
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-s'|'--semaphore-id')
|
||||
KEYIDS="$(lsipc -s --noheadings -o ID)"
|
||||
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-S'|'--semaphore-key')
|
||||
KEYIDS="$(lsipc -s --noheadings -o KEY)"
|
||||
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'--posix-semaphore')
|
||||
KEYIDS="$(lsipc -S --noheadings -o NAME)"
|
||||
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-h'|'--help'|'-V'|'--version')
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
case $cur in
|
||||
'=')
|
||||
cur=${cur#=}
|
||||
COMPREPLY=( $(compgen -W "shm pshm msg pmsg sem psem" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
OPTS=" --shmem-id
|
||||
--shmem-key
|
||||
--posix-shmem
|
||||
--queue-id
|
||||
--queue-key
|
||||
--posix-mqueue
|
||||
--semaphore-id
|
||||
--semaphore-key
|
||||
--posix-semaphore
|
||||
--all=
|
||||
--verbose
|
||||
--help
|
||||
--version"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _ipcrm_module ipcrm
|
33
bash-completion/ipcs
Normal file
33
bash-completion/ipcs
Normal file
|
@ -0,0 +1,33 @@
|
|||
_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
|
55
bash-completion/irqtop
Normal file
55
bash-completion/irqtop
Normal file
|
@ -0,0 +1,55 @@
|
|||
_irqtop_module()
|
||||
{
|
||||
local cur prev OPTS
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
case $prev in
|
||||
'-c'|'--cpu-stat')
|
||||
COMPREPLY=( $(compgen -W "auto enable disable" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-C'|'--cpu-list')
|
||||
return 0
|
||||
;;
|
||||
'-t'|'--threshold')
|
||||
return 0
|
||||
;;
|
||||
'-d'|'--delay')
|
||||
COMPREPLY=( $(compgen -W "secs" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-s'|'--sort')
|
||||
COMPREPLY=( $(compgen -W "irq total delta name" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-o'|'--output')
|
||||
local prefix realcur OUTPUT
|
||||
realcur="${cur##*,}"
|
||||
prefix="${cur%$realcur}"
|
||||
for WORD in "IRQ TOTAL DELTA NAME"; 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=" --cpu-stat
|
||||
--cpu-list
|
||||
--delay
|
||||
--sort
|
||||
--output
|
||||
--softirq
|
||||
--threshold
|
||||
--help
|
||||
--version"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _irqtop_module irqtop
|
27
bash-completion/isosize
Normal file
27
bash-completion/isosize
Normal file
|
@ -0,0 +1,27 @@
|
|||
_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
|
54
bash-completion/last
Normal file
54
bash-completion/last
Normal file
|
@ -0,0 +1,54 @@
|
|||
_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
|
||||
--tab-separated
|
||||
--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 lastb
|
57
bash-completion/lastlog2
Normal file
57
bash-completion/lastlog2
Normal file
|
@ -0,0 +1,57 @@
|
|||
_lastlog2_module()
|
||||
{
|
||||
local cur prev OPTS
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
case $prev in
|
||||
'-b'|'--before')
|
||||
COMPREPLY=( $(compgen -W "days" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-t'|'--time')
|
||||
COMPREPLY=( $(compgen -W "days" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-i'|'--import')
|
||||
COMPREPLY=( $(compgen -W "file" -- "$cur") )
|
||||
return 0
|
||||
;;
|
||||
'-r'|'--rename')
|
||||
COMPREPLY=( $(compgen -W "user_name" -- "$cur") )
|
||||
return 0
|
||||
;;
|
||||
'-u'|'--user')
|
||||
COMPREPLY=( $(compgen -W "login" -- "$cur") )
|
||||
return 0
|
||||
;;
|
||||
'-d'|'--database')
|
||||
COMPREPLY=( $(compgen -W "file" -- "$cur") )
|
||||
return 0
|
||||
;;
|
||||
'-h'|'--help'|'-V'|'--version')
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
case $cur in
|
||||
-*)
|
||||
OPTS="
|
||||
--before
|
||||
--clear
|
||||
--database
|
||||
--help
|
||||
--import
|
||||
--rename
|
||||
--service
|
||||
--set
|
||||
--time
|
||||
--user
|
||||
--version
|
||||
"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
complete -F _lastlog2_module lastlog2
|
68
bash-completion/ldattach
Normal file
68
bash-completion/ldattach
Normal file
|
@ -0,0 +1,68 @@
|
|||
_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
|
84
bash-completion/logger
Normal file
84
bash-completion/logger
Normal file
|
@ -0,0 +1,84 @@
|
|||
_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
|
||||
;;
|
||||
'--sd-id')
|
||||
COMPREPLY=( $(compgen -W "timeQuality origin meta" -- $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
|
||||
--sd-id
|
||||
--sd-param
|
||||
--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
|
45
bash-completion/look
Normal file
45
bash-completion/look
Normal file
|
@ -0,0 +1,45 @@
|
|||
_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)
|
||||
[ -f /usr/share/dict/words ] || return 0
|
||||
if [ "$cur" ]; then
|
||||
COMPREPLY=( $(compgen -W "$(look "$cur")" -- $cur) )
|
||||
else
|
||||
COMPREPLY=( $(compgen -W \
|
||||
"0 1 2 3 4 5 6 7 8 9 \
|
||||
a b c d e f g h i j k l m n o p \
|
||||
q r s t u v w x y z \
|
||||
A B C D E F G H I J K L M N O P \
|
||||
Q R S T U V W X Y Z") )
|
||||
fi
|
||||
;;
|
||||
2)
|
||||
local IFS=$'\n'
|
||||
compopt -o filenames
|
||||
COMPREPLY=( $(compgen -f -- $cur) )
|
||||
;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
complete -F _look_module look
|
79
bash-completion/losetup
Normal file
79
bash-completion/losetup
Normal file
|
@ -0,0 +1,79 @@
|
|||
_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
|
||||
--output-all
|
||||
--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
|
110
bash-completion/lsblk
Normal file
110
bash-completion/lsblk
Normal file
|
@ -0,0 +1,110 @@
|
|||
_lsblk_module()
|
||||
{
|
||||
local cur prev OPTS LSBLK_COLS_ALL
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
LSBLK_COLS_ALL="
|
||||
ALIGNMENT ID-LINK ID DISC-ALN DAX DISC-GRAN DISK-SEQ DISC-MAX
|
||||
DISC-ZERO FSAVAIL FSROOTS FSSIZE FSTYPE FSUSED FSUSE% FSVER
|
||||
GROUP HCTL HOTPLUG KNAME LABEL LOG-SEC MAJ:MIN MAJ MIN MIN-IO
|
||||
MODE MODEL MQ NAME OPT-IO OWNER PARTFLAGS PARTLABEL PARTN
|
||||
PARTTYPE PARTTYPENAME PARTUUID PATH PHY-SEC PKNAME PTTYPE
|
||||
PTUUID RA RAND REV RM RO ROTA RQ-SIZE SCHED SERIAL SIZE START
|
||||
STATE SUBSYSTEMS MOUNTPOINT MOUNTPOINTS TRAN TYPE UUID VENDOR
|
||||
WSAME WWN ZONED ZONE-SZ ZONE-WGRAN ZONE-APP ZONE-NR ZONE-OMAX
|
||||
ZONE-AMAX
|
||||
"
|
||||
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'|'-E'|'--dedup')
|
||||
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
|
||||
;;
|
||||
'--properties-by')
|
||||
compopt -o nospace
|
||||
COMPREPLY=( $(compgen -W "file udev blkid none" -- $cur) )
|
||||
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
|
||||
--filter
|
||||
--highlight
|
||||
--hyperlink
|
||||
--ct
|
||||
--ct-filter
|
||||
--help
|
||||
--include
|
||||
--json
|
||||
--ascii
|
||||
--list
|
||||
--dedup
|
||||
--merge
|
||||
--perms
|
||||
--noheadings
|
||||
--output
|
||||
--output-all
|
||||
--paths
|
||||
--pairs
|
||||
--properties-by
|
||||
--raw
|
||||
--inverse
|
||||
--topology
|
||||
--scsi
|
||||
--nvme
|
||||
--virtio
|
||||
--sort
|
||||
--width
|
||||
--list-columns
|
||||
--help
|
||||
--version"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
compopt -o bashdefault -o default
|
||||
COMPREPLY=( $(compgen -W "$($1 -pnro name)" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _lsblk_module lsblk
|
69
bash-completion/lsclocks
Normal file
69
bash-completion/lsclocks
Normal file
|
@ -0,0 +1,69 @@
|
|||
_lsclocks_module()
|
||||
{
|
||||
local cur prev OPTS
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
case $prev in
|
||||
'-J'|'--json')
|
||||
return 0
|
||||
;;
|
||||
'-n'|'--noheadings')
|
||||
return 0
|
||||
;;
|
||||
'-o'|'--output')
|
||||
return 0
|
||||
;;
|
||||
'--output-all')
|
||||
return 0
|
||||
;;
|
||||
'-r'|'--raw')
|
||||
return 0
|
||||
;;
|
||||
'-t'|'--time')
|
||||
clocks="$(command "$1" --noheadings --raw --output NAME)"
|
||||
COMPREPLY=( $(compgen -W "$clocks" -- "$cur") )
|
||||
return 0
|
||||
;;
|
||||
'-d'|'--dynamic-clock')
|
||||
clocks="$(echo /dev/ptp*)"
|
||||
COMPREPLY=( $(compgen -o filenames -W "$clocks" -- "$cur") )
|
||||
return 0
|
||||
;;
|
||||
'-x'|'--rtc')
|
||||
clocks="$(echo /dev/rtc*)"
|
||||
COMPREPLY=( $(compgen -o filenames -W "$clocks" -- "$cur") )
|
||||
return 0
|
||||
;;
|
||||
'-c'|'--cpu-clock')
|
||||
_pids
|
||||
return 0
|
||||
;;
|
||||
'-h'|'--help'|'-V'|'--version')
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
case $cur in
|
||||
-*)
|
||||
OPTS="--json
|
||||
--noheadings
|
||||
--output
|
||||
--output-all
|
||||
--raw
|
||||
--time
|
||||
--dynamic-clock
|
||||
--rtc
|
||||
--cpu-clock
|
||||
--help
|
||||
--version"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
complete -F _lsclocks_module lsclocks
|
55
bash-completion/lscpu
Normal file
55
bash-completion/lscpu
Normal file
|
@ -0,0 +1,55 @@
|
|||
_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
|
||||
--bytes
|
||||
--caches
|
||||
--offline
|
||||
--json
|
||||
--extended=
|
||||
--parse=
|
||||
--sysroot
|
||||
--hex
|
||||
--physical
|
||||
--output-all
|
||||
--raw
|
||||
--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
|
80
bash-completion/lsipc
Normal file
80
bash-completion/lsipc
Normal file
|
@ -0,0 +1,80 @@
|
|||
_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
|
||||
;;
|
||||
'-N'|'--name')
|
||||
COMPREPLY=( $(compgen -W "name" -- $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
|
||||
--posix-shmems
|
||||
--queues
|
||||
--posix-mqueues
|
||||
--semaphores
|
||||
--posix-semaphores
|
||||
--global
|
||||
--id
|
||||
--name
|
||||
--noheadings
|
||||
--notruncate
|
||||
--time-format
|
||||
--bytes
|
||||
--creator
|
||||
--export
|
||||
--json
|
||||
--newline
|
||||
--list
|
||||
--output
|
||||
--numeric-perms
|
||||
--raw
|
||||
--time
|
||||
--shell
|
||||
--help
|
||||
--version
|
||||
"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _lsipc_module lsipc
|
48
bash-completion/lsirq
Normal file
48
bash-completion/lsirq
Normal file
|
@ -0,0 +1,48 @@
|
|||
_lsirq_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
|
||||
realcur="${cur##*,}"
|
||||
prefix="${cur%$realcur}"
|
||||
for WORD in "IRQ TOTAL NAME"; do
|
||||
if ! [[ $prefix == *"$WORD"* ]]; then
|
||||
OUTPUT="$WORD ${OUTPUT:-""}"
|
||||
fi
|
||||
done
|
||||
compopt -o nospace
|
||||
COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) )
|
||||
return 0
|
||||
;;
|
||||
'-s'|'--sort')
|
||||
COMPREPLY=( $(compgen -W "irq total name" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-t'|'--threshold')
|
||||
return 0
|
||||
;;
|
||||
'-C'|'--cpu-list')
|
||||
return 0
|
||||
;;
|
||||
'-h'|'--help'|'-V'|'--version')
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
OPTS=" --json
|
||||
--pairs
|
||||
--noheadings
|
||||
--output
|
||||
--softirq
|
||||
--sort
|
||||
--threshold
|
||||
--cpu-list
|
||||
--help
|
||||
--version"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _lsirq_module lsirq
|
51
bash-completion/lslocks
Normal file
51
bash-completion/lslocks
Normal file
|
@ -0,0 +1,51 @@
|
|||
_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="--bytes
|
||||
--json
|
||||
--noinaccessible
|
||||
--noheadings
|
||||
--output
|
||||
--output-all
|
||||
--pid
|
||||
--raw
|
||||
--notruncate
|
||||
--list-columns
|
||||
--help
|
||||
--version
|
||||
"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
|
||||
}
|
||||
complete -F _lslocks_module lslocks
|
78
bash-completion/lslogins
Normal file
78
bash-completion/lslogins
Normal file
|
@ -0,0 +1,78 @@
|
|||
_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'|'--lastlog')
|
||||
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
|
||||
--output-all
|
||||
--pwd
|
||||
--raw
|
||||
--system-accs
|
||||
--time-format
|
||||
--user-accs
|
||||
--context
|
||||
--print0
|
||||
--wtmp-file
|
||||
--btmp-file
|
||||
--lastlog
|
||||
--help
|
||||
--version
|
||||
" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _lslogins_module lslogins
|
53
bash-completion/lsmem
Normal file
53
bash-completion/lsmem
Normal file
|
@ -0,0 +1,53 @@
|
|||
_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
|
||||
--output-all
|
||||
--raw
|
||||
--sysroot
|
||||
--summary
|
||||
--help
|
||||
--version
|
||||
"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _lsmem_module lsmem
|
61
bash-completion/lsns
Normal file
61
bash-completion/lsns
Normal file
|
@ -0,0 +1,61 @@
|
|||
_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 time" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-h'|'--help'|'-V'|'--version')
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
case $cur in
|
||||
-*)
|
||||
COMPREPLY=( $(compgen -W "
|
||||
--list-columns
|
||||
--filter
|
||||
--json
|
||||
--list
|
||||
--noheadings
|
||||
--output
|
||||
--output-all
|
||||
--persistent
|
||||
--task
|
||||
--raw
|
||||
--notruncate
|
||||
--nowrap
|
||||
--type
|
||||
--tree
|
||||
--help
|
||||
--version
|
||||
" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
complete -F _lsns_module lsns
|
31
bash-completion/mcookie
Normal file
31
bash-completion/mcookie
Normal file
|
@ -0,0 +1,31 @@
|
|||
_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
|
22
bash-completion/mesg
Normal file
22
bash-completion/mesg
Normal file
|
@ -0,0 +1,22 @@
|
|||
_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
|
28
bash-completion/mkfs
Normal file
28
bash-completion/mkfs
Normal file
|
@ -0,0 +1,28 @@
|
|||
_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
|
||||
compopt -o bashdefault -o default
|
||||
COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _mkfs_module mkfs
|
31
bash-completion/mkfs.bfs
Normal file
31
bash-completion/mkfs.bfs
Normal file
|
@ -0,0 +1,31 @@
|
|||
_mkfs.bfs_module()
|
||||
{
|
||||
local cur prev OPTS
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
case $prev in
|
||||
'-N'|'--inodes')
|
||||
COMPREPLY=( $(compgen -W "number" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-V'|'--vname'|'-F'|'--fname')
|
||||
COMPREPLY=( $(compgen -W "name" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-h'|'--help'|'--version')
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
case $cur in
|
||||
-*)
|
||||
OPTS='--inodes --vname --fname --verbose --help --version'
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
compopt -o bashdefault -o default
|
||||
COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _mkfs.bfs_module mkfs.bfs
|
43
bash-completion/mkfs.cramfs
Normal file
43
bash-completion/mkfs.cramfs
Normal file
|
@ -0,0 +1,43 @@
|
|||
_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
|
||||
compopt -o bashdefault -o default
|
||||
COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _mkfs.cramfs_module mkfs.cramfs
|
33
bash-completion/mkfs.minix
Normal file
33
bash-completion/mkfs.minix
Normal file
|
@ -0,0 +1,33 @@
|
|||
_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
|
||||
compopt -o bashdefault -o default
|
||||
COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _mkfs.minix_module mkfs.minix
|
47
bash-completion/mkswap
Normal file
47
bash-completion/mkswap
Normal file
|
@ -0,0 +1,47 @@
|
|||
_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
|
||||
;;
|
||||
'-o'|'--offset')
|
||||
COMPREPLY=( $(compgen -W "bytes" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-s'|'--size')
|
||||
COMPREPLY=( $(compgen -W "bytes" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-h'|'--help'|'-V'|'--version')
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
case $cur in
|
||||
-*)
|
||||
OPTS="--check --force --pagesize --lock --label --swapversion --uuid --offset --verbose --version --help --size --file"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
compopt -o bashdefault -o default
|
||||
COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _mkswap_module mkswap
|
45
bash-completion/more
Normal file
45
bash-completion/more
Normal file
|
@ -0,0 +1,45 @@
|
|||
_more_module()
|
||||
{
|
||||
local cur prev OPTS
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
case $prev in
|
||||
'-n'|'--lines')
|
||||
COMPREPLY=( $(compgen -W "number" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-h'|'--help'|'-V'|'--version')
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
case $cur in
|
||||
-*)
|
||||
OPTS="
|
||||
--silent
|
||||
--logical
|
||||
--no-pause
|
||||
--print-over
|
||||
--clean-print
|
||||
--squeeze
|
||||
--plain
|
||||
--lines
|
||||
--help
|
||||
--version
|
||||
"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
+*)
|
||||
OPTS="+number +/pattern"
|
||||
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
|
102
bash-completion/mount
Normal file
102
bash-completion/mount
Normal file
|
@ -0,0 +1,102 @@
|
|||
_mount_module()
|
||||
{
|
||||
local cur prev OPTS
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
case $prev in
|
||||
'-t'|'--types')
|
||||
local prefix realcur TYPES
|
||||
TYPES="
|
||||
$(\ls /lib/modules/$(uname -r)/kernel/fs | awk '{print $1, "no" $1}')
|
||||
$(awk '{print $NF, "no" $NF}' /proc/filesystems)
|
||||
"
|
||||
realcur="${cur##*,}"
|
||||
prefix="${cur%$realcur}"
|
||||
for WORD in $TYPES; do
|
||||
if ! [[ $prefix == *"$WORD"* ]]; then
|
||||
TYPE_COLS="$WORD ${TYPE_COLS:-""}"
|
||||
fi
|
||||
done
|
||||
compopt -o nospace
|
||||
COMPREPLY=( $(compgen -P "$prefix" -W "$TYPE_COLS" -S ',' -- $realcur) )
|
||||
return 0
|
||||
;;
|
||||
'-L'|'--label')
|
||||
local LABELS
|
||||
LABELS="$(lsblk -o LABEL -nr)"
|
||||
COMPREPLY=( $(compgen -W "$LABELS" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-U'|'--uuid')
|
||||
local UUIDS
|
||||
UUIDS="$(lsblk -o UUID -nr)"
|
||||
COMPREPLY=( $(compgen -W "$UUIDS" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-N'|'--namespace')
|
||||
local NAMESPACE
|
||||
NAMESPACE="$(lsns --type mnt --output PATH --noheadings)"
|
||||
COMPREPLY=( $(compgen -W "$NAMESPACE" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'--options-mode')
|
||||
COMPREPLY=( $(compgen -W "ignore append prepend replace" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'--options-source')
|
||||
COMPREPLY=( $(compgen -W "fstab mtab disable" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-h'|'--help'|'-V'|'--version')
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
case $cur in
|
||||
-*)
|
||||
OPTS=" --all
|
||||
--no-canonicalize
|
||||
--fake
|
||||
--fork
|
||||
--fstab
|
||||
--help
|
||||
--internal-only
|
||||
--show-labels
|
||||
--no-mtab
|
||||
--options
|
||||
--options-mode
|
||||
--options-source
|
||||
--options-source-force
|
||||
--test-opts
|
||||
--read-only
|
||||
--types
|
||||
--source
|
||||
--target
|
||||
--verbose
|
||||
--version
|
||||
--read-write
|
||||
--namespace
|
||||
--label
|
||||
--uuid
|
||||
--bind
|
||||
--move
|
||||
--rbind
|
||||
--make-shared
|
||||
--make-slave
|
||||
--make-private
|
||||
--make-unbindable
|
||||
--make-rshared
|
||||
--make-rslave
|
||||
--make-rprivate
|
||||
--make-runbindable
|
||||
--mkdir"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
local IFS=$'\n'
|
||||
compopt -o filenames
|
||||
COMPREPLY=( $(compgen -f -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _mount_module mount
|
24
bash-completion/mountpoint
Normal file
24
bash-completion/mountpoint
Normal file
|
@ -0,0 +1,24 @@
|
|||
_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 --nofollow --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
|
24
bash-completion/namei
Normal file
24
bash-completion/namei
Normal file
|
@ -0,0 +1,24 @@
|
|||
_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
|
30
bash-completion/newgrp
Normal file
30
bash-completion/newgrp
Normal file
|
@ -0,0 +1,30 @@
|
|||
_newgrp_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
|
||||
;;
|
||||
'-c'|'--command')
|
||||
COMPREPLY=( $(compgen -c -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
case $cur in
|
||||
-*)
|
||||
OPTS="--version --help --command"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
if (( COMP_CWORD == 1 )) || [[ " ${COMP_WORDS[@]}" =~ " "-?-c ]]; then
|
||||
COMPREPLY=( $(compgen -g -- $cur) )
|
||||
else
|
||||
COMPREPLY=( $(compgen -c -- $cur) )
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
complete -F _newgrp_module newgrp
|
70
bash-completion/nsenter
Normal file
70
bash-completion/nsenter
Normal file
|
@ -0,0 +1,70 @@
|
|||
_nsenter_module()
|
||||
{
|
||||
local cur prev OPTS
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
case $prev in
|
||||
'-S'|'--uid')
|
||||
COMPREPLY=( follow $(compgen -W "uid" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-G'|'--gid')
|
||||
COMPREPLY=( follow $(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=
|
||||
--net-socket
|
||||
--pid=
|
||||
--cgroup=
|
||||
--user=
|
||||
--user-parent
|
||||
--time=
|
||||
--setuid
|
||||
--setgid
|
||||
--keep-caps
|
||||
--preserve-credentials
|
||||
--root=
|
||||
--wd=
|
||||
--wdns=
|
||||
--env
|
||||
--no-fork
|
||||
--join-cgroup
|
||||
--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
|
66
bash-completion/partx
Normal file
66
bash-completion/partx
Normal file
|
@ -0,0 +1,66 @@
|
|||
_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
|
||||
--output-all
|
||||
--pairs
|
||||
--raw
|
||||
--sector-size
|
||||
--type
|
||||
--list-types
|
||||
--verbose
|
||||
--help
|
||||
--version
|
||||
"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
compopt -o bashdefault -o default
|
||||
COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _partx_module partx
|
33
bash-completion/pg
Normal file
33
bash-completion/pg
Normal file
|
@ -0,0 +1,33 @@
|
|||
_pg_module()
|
||||
{
|
||||
local cur prev OPTS
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
case $prev in
|
||||
'-p')
|
||||
COMPREPLY=( $(compgen -W "prompt" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-h'|'-V')
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
case $cur in
|
||||
-*)
|
||||
OPTS="-number -c -e -f -n -p -r -s -h -V"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
+*)
|
||||
OPTS="+number +/pattern/"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
local IFS=$'\n'
|
||||
compopt -o filenames
|
||||
COMPREPLY=( $(compgen -f -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _pg_module pg
|
102
bash-completion/pipesz
Normal file
102
bash-completion/pipesz
Normal file
|
@ -0,0 +1,102 @@
|
|||
_pipesz_module()
|
||||
{
|
||||
local WORD OPTS OPTARG OPTEND SOPT LOPT TARG
|
||||
local SOPTS=(g s f n i o e c q v h V)
|
||||
local LOPTS=(get set file fd stdin stdout stderr check quiet verbose help version)
|
||||
local AOPTS=(0 1 1 1 0 0 0 0 0 0 0 0) # takes argument
|
||||
local TOPTS=(1 0 1 1 1 1 1 0 0 0 0 0) # specifies target
|
||||
local XOPTS=(0 0 0 0 0 0 0 0 0 0 1 1) # exits immediately
|
||||
local MOPTS=(0 0 1 1 0 0 0 0 0 0 0 0) # repeatable
|
||||
local NOPTS=(0 0 0 0 0 0 0 0 0 0 0 0) # number of repeats
|
||||
local IDXG=0 IDXS=1 # index of --get and --set
|
||||
|
||||
for ((i=1; i<COMP_CWORD; i++)); do
|
||||
WORD=${COMP_WORDS[i]}
|
||||
|
||||
if [[ ${NOPTS[$IDXG]} -eq 0 ]]; then
|
||||
case $WORD in
|
||||
--)
|
||||
_command_offset $((i+1))
|
||||
return 0;;
|
||||
[^-]*)
|
||||
_command_offset $i
|
||||
return 0;;
|
||||
esac
|
||||
fi
|
||||
|
||||
for ((j=0; j<${#NOPTS[@]}; j++)); do
|
||||
SOPT=${SOPTS[$j]}
|
||||
LOPT=${LOPTS[$j]}
|
||||
|
||||
case $WORD in
|
||||
--$LOPT) OPTEND=l;;
|
||||
--*) continue;;
|
||||
-*$SOPT) OPTEND=s;;
|
||||
-*$SOPT*) OPTEND=n;;
|
||||
*) continue;;
|
||||
esac
|
||||
|
||||
if [[ ${XOPTS[$j]} -ne 0 ]]; then
|
||||
COMPREPLY=()
|
||||
return 0
|
||||
fi
|
||||
|
||||
((NOPTS[j]++))
|
||||
|
||||
[[ ${TOPTS[$j]} -ne 0 ]] && TARG=y
|
||||
[[ $OPTEND != n ]] && ((i+=AOPTS[j]))
|
||||
[[ $OPTEND == l ]] && break
|
||||
done
|
||||
done
|
||||
|
||||
case $3 in
|
||||
--fd) OPTARG=n;;
|
||||
--file) OPTARG=f;;
|
||||
--size) OPTARG=s;;
|
||||
--*) ;;
|
||||
-*n) OPTARG=n;;
|
||||
-*f) OPTARG=f;;
|
||||
-*s) OPTARG=s;;
|
||||
esac
|
||||
|
||||
case $OPTARG in
|
||||
f)
|
||||
compopt -o filenames
|
||||
COMPREPLY=( $(compgen -f -- "$2") )
|
||||
return 0;;
|
||||
n)
|
||||
COMPREPLY=( $(compgen -W "0 1 2" -- "$2") )
|
||||
return 0;;
|
||||
s)
|
||||
WORD=$2
|
||||
if [[ ! $WORD =~ ^[0-9]+[a-zA-Z]*$ ]]; then
|
||||
COMPREPLY=()
|
||||
return 0
|
||||
fi
|
||||
|
||||
while [[ $WORD =~ [a-zA-Z]$ ]]; do WORD=${WORD:0:-1}; done
|
||||
|
||||
compopt -o nosort
|
||||
COMPREPLY=( $(compgen -W "$WORD $WORD{K,M,G}{B,iB}" -- "$2") )
|
||||
return 0;;
|
||||
esac
|
||||
|
||||
for ((j=0; j<${#NOPTS[@]}; j++)); do
|
||||
[[ $j -eq $IDXG && ${NOPTS[$IDXS]} -ne 0 ]] && continue
|
||||
[[ $j -eq $IDXS && ${NOPTS[$IDXG]} -ne 0 ]] && continue
|
||||
[[ $COMP_CWORD -ne 1 && ${XOPTS[$j]} -ne 0 ]] && continue
|
||||
[[ ${NOPTS[$j]} -gt 0 && ${MOPTS[$j]} -eq 0 ]] && continue
|
||||
|
||||
[[ $2 != --* && $2 == -* ]] && OPTS+=" -${SOPTS[$j]}"
|
||||
OPTS+=" --${LOPTS[$j]}"
|
||||
done
|
||||
|
||||
if [[ ! $TARG || ${NOPTS[$IDXG]} -ne 0 ]]; then
|
||||
COMPREPLY=( $(compgen -W "$OPTS" -- "$2") )
|
||||
else
|
||||
compopt -o filenames
|
||||
COMPREPLY=( $(compgen -c -W "$OPTS --" -- "$2") )
|
||||
fi
|
||||
}
|
||||
|
||||
complete -F _pipesz_module pipesz
|
21
bash-completion/pivot_root
Normal file
21
bash-completion/pivot_root
Normal file
|
@ -0,0 +1,21 @@
|
|||
_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
|
69
bash-completion/prlimit
Normal file
69
bash-completion/prlimit
Normal file
|
@ -0,0 +1,69 @@
|
|||
_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
|
23
bash-completion/raw
Normal file
23
bash-completion/raw
Normal file
|
@ -0,0 +1,23 @@
|
|||
_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
|
37
bash-completion/readprofile
Normal file
37
bash-completion/readprofile
Normal file
|
@ -0,0 +1,37 @@
|
|||
_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
|
34
bash-completion/rename
Normal file
34
bash-completion/rename
Normal file
|
@ -0,0 +1,34 @@
|
|||
_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 --all --last --no-overwrite --interactive"
|
||||
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
|
41
bash-completion/renice
Normal file
41
bash-completion/renice
Normal file
|
@ -0,0 +1,41 @@
|
|||
_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
|
28
bash-completion/resizepart
Normal file
28
bash-completion/resizepart
Normal file
|
@ -0,0 +1,28 @@
|
|||
_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)"
|
||||
compopt -o bashdefault -o default
|
||||
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
|
24
bash-completion/rev
Normal file
24
bash-completion/rev
Normal file
|
@ -0,0 +1,24 @@
|
|||
_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 --zero"
|
||||
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
|
49
bash-completion/rfkill
Normal file
49
bash-completion/rfkill
Normal file
|
@ -0,0 +1,49 @@
|
|||
_rfkill_module()
|
||||
{
|
||||
local cur prev OPTS
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
case $prev in
|
||||
'list'|'block'|'unblock'|'toggle')
|
||||
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
|
||||
toggle
|
||||
--json
|
||||
--noheadings
|
||||
--output
|
||||
--output-all
|
||||
--raw
|
||||
--help
|
||||
--version
|
||||
"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
|
||||
}
|
||||
complete -F _rfkill_module rfkill
|
59
bash-completion/rtcwake
Normal file
59
bash-completion/rtcwake
Normal file
|
@ -0,0 +1,59 @@
|
|||
_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
|
59
bash-completion/script
Normal file
59
bash-completion/script
Normal file
|
@ -0,0 +1,59 @@
|
|||
_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
|
||||
;;
|
||||
'-E'|'--echo')
|
||||
COMPREPLY=( $(compgen -W "auto always never" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-o'|'--output-limit')
|
||||
COMPREPLY=( $(compgen -W "size" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-m'|'--logging-format')
|
||||
COMPREPLY=( $(compgen -W "classic advanced" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-h'|'--help'|'-V'|'--version')
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
case $cur in
|
||||
'=')
|
||||
cur=${cur#=}
|
||||
;;
|
||||
-*)
|
||||
OPTS="--append
|
||||
--command
|
||||
--echo
|
||||
--log-in
|
||||
--log-out
|
||||
--log-io
|
||||
--log-timing
|
||||
--logging-format
|
||||
--return
|
||||
--flush
|
||||
--force
|
||||
--quiet
|
||||
--output-limit
|
||||
--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
|
41
bash-completion/scriptlive
Normal file
41
bash-completion/scriptlive
Normal file
|
@ -0,0 +1,41 @@
|
|||
_scriptlive_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
|
||||
;;
|
||||
'-d'|'--divisor'|'-m'|'--maxdelay')
|
||||
COMPREPLY=( $(compgen -W "digit" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-h'|'--help'|'-V'|'--version')
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
case $cur in
|
||||
-*)
|
||||
OPTS="--timing
|
||||
--log-in
|
||||
--log-io
|
||||
--log-timing
|
||||
--command
|
||||
--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 _scriptlive_module scriptlive
|
48
bash-completion/scriptreplay
Normal file
48
bash-completion/scriptreplay
Normal file
|
@ -0,0 +1,48 @@
|
|||
_scriptreplay_module()
|
||||
{
|
||||
local cur prev OPTS
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
case $prev in
|
||||
'-c'|'--cr-mode')
|
||||
COMPREPLY=( $(compgen -W "auto never always" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-d'|'--divisor'|'-m'|'--maxdelay')
|
||||
COMPREPLY=( $(compgen -W "digit" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-x'|'--stream')
|
||||
COMPREPLY=( $(compgen -W "out in signal info" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-h'|'--help'|'-V'|'--version')
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
case $cur in
|
||||
-*)
|
||||
OPTS="--timing
|
||||
--log-in
|
||||
--log-out
|
||||
--log-io
|
||||
--log-timing
|
||||
--summary
|
||||
--stream
|
||||
--cr-mode
|
||||
--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
|
44
bash-completion/setarch
Normal file
44
bash-completion/setarch
Normal file
|
@ -0,0 +1,44 @@
|
|||
_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
|
23
bash-completion/setpgid
Normal file
23
bash-completion/setpgid
Normal file
|
@ -0,0 +1,23 @@
|
|||
_setpgid_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="--foreground --help --version"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
compopt -o bashdefault
|
||||
COMPREPLY=( $(compgen -c -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _setpgid_module setpgid
|
142
bash-completion/setpriv
Normal file
142
bash-completion/setpriv
Normal file
|
@ -0,0 +1,142 @@
|
|||
_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 $1}')
|
||||
COMPREPLY=( $(compgen -W "$UIDS" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'--rgid'|'--egid'|'--regid')
|
||||
local GIDS
|
||||
GIDS=$(getent group | awk -F: '{print $1}')
|
||||
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 prefix realcur SBITS_ALL SBITS WORD
|
||||
realcur="${cur##*,}"
|
||||
prefix="${cur%$realcur}"
|
||||
SBITS_ALL="
|
||||
{+,-}keep_caps_locked
|
||||
{+,-}noroot
|
||||
{+,-}noroot_locked
|
||||
{+,-}no_setuid_fixup
|
||||
{+,-}no_setuid_fixup_locked
|
||||
"
|
||||
for WORD in $SBITS_ALL; do
|
||||
if ! [[ $prefix == *"$WORD"* ]]; then
|
||||
SBITS="$WORD ${SBITS:-""}"
|
||||
fi
|
||||
done
|
||||
compopt -o nospace
|
||||
COMPREPLY=( $(compgen -P "$prefix" -W "$SBITS" -S ',' -- $realcur) )
|
||||
return 0
|
||||
;;
|
||||
'--pdeathsig')
|
||||
local i signals
|
||||
for i in $(kill -l); do
|
||||
case $i in
|
||||
SIG*)
|
||||
signals+="$i "
|
||||
;;
|
||||
esac
|
||||
done
|
||||
COMPREPLY=( $(compgen -W "keep clear $signals" -- $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
|
||||
;;
|
||||
'--landlock-access')
|
||||
# FIXME: how to list landlock accesses?
|
||||
COMPREPLY=( $(compgen -W "access" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'--landlock-rule')
|
||||
# FIXME: how to list landlock rules?
|
||||
COMPREPLY=( $(compgen -W "rule" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'--seccomp-filter')
|
||||
COMPREPLY=( $(compgen -f -- $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-groups
|
||||
--keep-groups
|
||||
--groups
|
||||
--securebits
|
||||
--pdeathsig
|
||||
--reset-env
|
||||
--selinux-label
|
||||
--apparmor-profile
|
||||
--landlock-access
|
||||
--landlock-rule
|
||||
--seccomp-filter
|
||||
--help
|
||||
--version"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
compopt -o bashdefault
|
||||
COMPREPLY=( $(compgen -c -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _setpriv_module setpriv
|
23
bash-completion/setsid
Normal file
23
bash-completion/setsid
Normal file
|
@ -0,0 +1,23 @@
|
|||
_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
|
127
bash-completion/setterm
Normal file
127
bash-completion/setterm
Normal file
|
@ -0,0 +1,127 @@
|
|||
_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
|
103
bash-completion/sfdisk
Normal file
103
bash-completion/sfdisk
Normal file
|
@ -0,0 +1,103 @@
|
|||
_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')
|
||||
compopt -o bashdefault -o default
|
||||
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
|
||||
--discard-free
|
||||
--disk-id
|
||||
--reorder
|
||||
--show-size
|
||||
--list-types
|
||||
--verify
|
||||
--relocate
|
||||
--delete
|
||||
--part-label
|
||||
--part-type
|
||||
--part-uuid
|
||||
--part-attrs
|
||||
--append
|
||||
--backup
|
||||
--backup-pt-sectors
|
||||
--bytes
|
||||
--move-data
|
||||
--force
|
||||
--color
|
||||
--lock
|
||||
--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
|
||||
compopt -o bashdefault -o default
|
||||
COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _sfdisk_module sfdisk
|
54
bash-completion/su
Normal file
54
bash-completion/su
Normal file
|
@ -0,0 +1,54 @@
|
|||
_su_module()
|
||||
{
|
||||
local cur prev OPTS prog
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
prog="${COMP_WORDS[0]}"
|
||||
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=" --preserve-environment
|
||||
--whitelist-environment
|
||||
--group
|
||||
--supp-group
|
||||
--login
|
||||
--command
|
||||
--session-command
|
||||
--fast
|
||||
--shell
|
||||
--pty
|
||||
--no-pty
|
||||
--help
|
||||
--version"
|
||||
if [ "${prog}" = runuser ]; then
|
||||
OPTS=" ${OPTS}
|
||||
--user"
|
||||
fi
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
local IFS=$'\n'
|
||||
compopt -o filenames
|
||||
COMPREPLY=( $(compgen -u -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _su_module su
|
||||
complete -F _su_module runuser
|
32
bash-completion/swaplabel
Normal file
32
bash-completion/swaplabel
Normal file
|
@ -0,0 +1,32 @@
|
|||
_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
|
38
bash-completion/swapoff
Normal file
38
bash-completion/swapoff
Normal file
|
@ -0,0 +1,38 @@
|
|||
_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
|
85
bash-completion/swapon
Normal file
85
bash-completion/swapon
Normal file
|
@ -0,0 +1,85 @@
|
|||
_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'|'UUID=')
|
||||
local UUIDS
|
||||
UUIDS="$(lsblk -nrp -o FSTYPE,UUID | awk '$1 ~ /swap/ { print $2 }')"
|
||||
COMPREPLY=( $(compgen -W "$UUIDS" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-L'|'LABEL=')
|
||||
local LABELS
|
||||
LABELS="$(lsblk -nrp -o FSTYPE,LABEL | awk '$1 ~ /swap/ { print $2 }')"
|
||||
COMPREPLY=( $(compgen -W "$LABELS" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'PARTUUID=')
|
||||
local PARTUUIDS
|
||||
PARTUUIDS="$(lsblk -nrp -o FSTYPE,PARTUUID | awk '$1 ~ /swap/ { print $2 }')"
|
||||
COMPREPLY=( $(compgen -W "$PARTUUIDS" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'PARTLABEL=')
|
||||
local PARTLABELS
|
||||
PARTLABELS="$(lsblk -nrp -o FSTYPE,PARTLABEL | awk '$1 ~ /swap/ { print $2 }')"
|
||||
COMPREPLY=( $(compgen -W "$PARTLABELS" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-h'|'--help'|'-V'|'--version')
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
case $cur in
|
||||
-*)
|
||||
OPTS="--all
|
||||
--discard
|
||||
--ifexists
|
||||
--fixpgsz
|
||||
--fstab
|
||||
--priority
|
||||
--summary
|
||||
--show
|
||||
--output-all
|
||||
--noheadings
|
||||
--raw
|
||||
--bytes
|
||||
--verbose
|
||||
-L
|
||||
-U
|
||||
--help
|
||||
--version"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
local DEVS
|
||||
DEVS="$(lsblk -nrp -o FSTYPE,NAME | awk '$1 ~ /swap/ { print $2 }')"
|
||||
compopt -o nospace
|
||||
COMPREPLY=( $(compgen -fW "$DEVS LABEL= UUID= PARTLABEL= PARTUUID=" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _swapon_module swapon
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue