/
githubmirror
/
libcap-ng
Обзор
Документация
Войти
/
githubmirror
/
libcap-ng
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v0.9.3
utils/libcap-ng.bash_completion
94 строки
2 KB
Steve Grubb
update man page and bash completions for cap-audits -h option
09 апр 2026, 19:16
09 апр 2026, 19:16
f5f318a
Код
Авторство
О чём код?
_pscap() { local cur prev local opts="-a -p --tree" COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case "$prev" in -p) COMPREPLY=( $(compgen -W "$(ps -eo pid= 2>/dev/null)" \ -- "$cur") ) return 0 ;; esac if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) fi } _netcap() { local cur prev local opts="--advanced --interface --list-interfaces --json --no-color" COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case "$prev" in --interface) COMPREPLY=( $(compgen -W "$(command ls /sys/class/net \ 2>/dev/null)" -- "$cur") ) return 0 ;; esac if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) fi } _filecap() { local cur prev local opts="-a -d" COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) return 0 fi case "$prev" in -a|-d) return 0 ;; esac if [[ "$cur" == /* ]]; then COMPREPLY=( $(compgen -d -- "$cur") $(compgen -f -- "$cur") ) fi } _cap_audit() { local cur prev local opts="-h --help -v --verbose -j --json -y --yaml --" COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" if [[ "$prev" == "--" ]]; then COMPREPLY=( $(compgen -c -- "$cur") ) return 0 fi if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) else COMPREPLY=( $(compgen -c -- "$cur") ) fi } complete -F _pscap pscap complete -F _netcap netcap complete -F _filecap filecap complete -F _cap_audit cap-audit