]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
bash-completion: add getino completions
authorChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Sun, 21 Dec 2025 01:01:08 +0000 (20:01 -0500)
committerChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Thu, 8 Jan 2026 01:08:23 +0000 (20:08 -0500)
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
bash-completion/Makemodule.am
bash-completion/getino [new file with mode: 0644]

index 3b75ef2314e1acdcbb329db51cc31843adfdc28b..2446da652b6f29f8845f378f41870a32f5acbce7 100644 (file)
@@ -374,5 +374,8 @@ endif
 if BUILD_LSCLOCKS
 dist_bashcompletion_DATA += bash-completion/lsclocks
 endif
+if BUILD_GETINO
+dist_bashcompletion_DATA += bash-completion/getino
+endif
 
 endif # BUILD_BASH_COMPLETION
diff --git a/bash-completion/getino b/bash-completion/getino
new file mode 100644 (file)
index 0000000..2288104
--- /dev/null
@@ -0,0 +1,40 @@
+_getino_module()
+{
+        local cur prev OPTS
+        COMPREPLY=()
+        cur="${COMP_WORDS[COMP_CWORD]}"
+        prev="${COMP_WORDS[COMP_CWORD-1]}"
+        case $prev in
+                '-p'|'--print-pid')
+                        return 0
+                        ;;
+                '-h'|'--help'|'-V'|'--version')
+                        return 0
+                        ;;
+        esac
+        case $cur in
+                -*)
+                        OPTS='
+                        --print-pid
+                        --pidfs
+                        --cgroupns
+                        --ipcns
+                        --netns
+                        --mntns
+                        --pidns
+                        --timens
+                        --userns
+                        --utsns
+                        --help
+                        --version'
+                        COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
+                        return 0
+                        ;;
+                *)
+                        _pids
+                        return 0
+                        ;;
+        esac
+        return 0
+}
+complete -F _getino_module getino