From ac5267423d3ca26e315d690900e443ff541d23a8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Thu, 4 May 2023 20:15:04 +0200 Subject: [PATCH] enosys: add bash completion MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Weißschuh --- bash-completion/Makemodule.am | 3 +++ bash-completion/enosys | 33 +++++++++++++++++++++++++++++++++ meson.build | 1 + 3 files changed, 37 insertions(+) create mode 100644 bash-completion/enosys diff --git a/bash-completion/Makemodule.am b/bash-completion/Makemodule.am index eb10f6f705..ac8926f2d0 100644 --- a/bash-completion/Makemodule.am +++ b/bash-completion/Makemodule.am @@ -344,5 +344,8 @@ endif if BUILD_WAITPID dist_bashcompletion_DATA += bash-completion/waitpid endif +if BUILD_ENOSYS +dist_bashcompletion_DATA += bash-completion/enosys +endif endif # BUILD_BASH_COMPLETION diff --git a/bash-completion/enosys b/bash-completion/enosys new file mode 100644 index 0000000000..4f63e6640a --- /dev/null +++ b/bash-completion/enosys @@ -0,0 +1,33 @@ +_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 + ;; + '-h'|'--help'|'-V'|'--version') + return 0 + ;; + esac + case $cur in + -*) + OPTS="--syscall + --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 diff --git a/meson.build b/meson.build index 42f255d62b..3a535339aa 100644 --- a/meson.build +++ b/meson.build @@ -2865,6 +2865,7 @@ exe = executable( install : true) if not is_disabler(exe) exes += exe + bashcompletions += ['enosys'] endif ############################################################ -- 2.47.3