From 80af57ed9edf153d26b5ace9a283c24cb5a22762 Mon Sep 17 00:00:00 2001 From: Nathan Sharp Date: Mon, 11 Apr 2022 22:59:30 -0600 Subject: [PATCH] pipesz: add bash-completion script Signed-off-by: Nathan Sharp --- bash-completion/Makemodule.am | 3 + bash-completion/pipesz | 102 ++++++++++++++++++++++++++++++++++ meson.build | 1 + 3 files changed, 106 insertions(+) create mode 100644 bash-completion/pipesz diff --git a/bash-completion/Makemodule.am b/bash-completion/Makemodule.am index f85211476f..5d59b5593f 100644 --- a/bash-completion/Makemodule.am +++ b/bash-completion/Makemodule.am @@ -335,5 +335,8 @@ endif if BUILD_HARDLINK dist_bashcompletion_DATA += bash-completion/hardlink endif +if BUILD_PIPESZ +dist_bashcompletion_DATA += bash-completion/pipesz +endif endif # BUILD_BASH_COMPLETION diff --git a/bash-completion/pipesz b/bash-completion/pipesz new file mode 100644 index 0000000000..592075cf30 --- /dev/null +++ b/bash-completion/pipesz @@ -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