From d0b269ba5523bbd66f1dba5e89cc0c4fdc2e0e1a Mon Sep 17 00:00:00 2001 From: unrealapex Date: Thu, 3 Jul 2025 23:46:47 -0700 Subject: [PATCH 1/3] WIP: 'abduco' completion --- share/completion/abduco | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 share/completion/abduco diff --git a/share/completion/abduco b/share/completion/abduco new file mode 100644 index 00000000..35738a68 --- /dev/null +++ b/share/completion/abduco @@ -0,0 +1,33 @@ +# (C) 2025 unrealapex + +# Completion script for abduco + +function completion/abduco { + + typeset OPTIONS ARGOPT PREFIX + OPTIONS=( #># + "v; print version information to standard output and exit" + "r; readonly session" + "e; set the key to detach" + "f; force creation of session when there is already terminated session of the same name" + "c; create a new session and attach to it" + "n; create a new session but do not attach to it" + "A; try to connect to an existing session, upon failure create said session and attach to it" + "a; attach to an existing session" + "l; attach with the lowest priority" + ) #<# + + command -f completion//parseoptions -es + case $ARGOPT in + (-) + command -f completion//completeoptions + ;; + (-A|-a|-f) + # FIXME: figure out why this isn't completing + complete -P "$PREFIX" -- $(abduco | tail -n+2 | awk '{print $NF}') + ;; + esac + +} + +# vim: set ft=sh ts=8 sts=8 sw=8 et: From 6f5efe2c26ba0899a5a03534e618fcf9267b48f7 Mon Sep 17 00:00:00 2001 From: Erin Date: Tue, 22 Jul 2025 01:21:33 -0700 Subject: [PATCH 2/3] Make `e` option take argument Co-authored-by: WATANABE Yuki --- share/completion/abduco | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/completion/abduco b/share/completion/abduco index 35738a68..7cb4f07a 100644 --- a/share/completion/abduco +++ b/share/completion/abduco @@ -8,7 +8,7 @@ function completion/abduco { OPTIONS=( #># "v; print version information to standard output and exit" "r; readonly session" - "e; set the key to detach" + "e:; set the key to detach" "f; force creation of session when there is already terminated session of the same name" "c; create a new session and attach to it" "n; create a new session but do not attach to it" From a76a01d71f4983668afd6cc9b426a7ac999fbc4c Mon Sep 17 00:00:00 2001 From: Erin Date: Tue, 22 Jul 2025 01:21:47 -0700 Subject: [PATCH 3/3] Update share/completion/abduco Co-authored-by: WATANABE Yuki --- share/completion/abduco | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/completion/abduco b/share/completion/abduco index 7cb4f07a..9e065c7e 100644 --- a/share/completion/abduco +++ b/share/completion/abduco @@ -22,7 +22,7 @@ function completion/abduco { (-) command -f completion//completeoptions ;; - (-A|-a|-f) + ('') # FIXME: figure out why this isn't completing complete -P "$PREFIX" -- $(abduco | tail -n+2 | awk '{print $NF}') ;;