commit 204d8231ab7fac255d4cc470894de291de7bf6c3 parent 7cceb5ba2795c7ac9ebe2e223c8971fa238e920a Author: Sean Enck <sean@ttypty.com> Date: Sun, 12 Dec 2021 18:38:44 -0500 handle new keyword Diffstat:
| M | cmd/lb-bash/completions.bash | | | 16 | ++++++++++++---- |
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/cmd/lb-bash/completions.bash b/cmd/lb-bash/completions.bash @@ -9,7 +9,7 @@ _is_clip() { } _lb() { - local cur opts clip_enabled + local cur opts clip_enabled needs clip_enabled=" -c clip" if [ -n "$LOCKBOX_CLIPMODE" ]; then if [ "$LOCKBOX_CLIPMODE" == "off" ]; then @@ -56,11 +56,19 @@ _lb() { fi ;; "totp") - if [ -n "$clip_enabled" ]; then - if [ $(_is_clip "${COMP_WORDS[2]}" "-") == 1 ]; then - opts=$(lb totp ls) + needs=0 + if [ "${COMP_WORDS[2]}" == "-once" ]; then + needs=1 + else + if [ -n "$clip_enabled" ]; then + if [ $(_is_clip "${COMP_WORDS[2]}" "-") == 1 ]; then + needs=1 + fi fi fi + if [ $needs -eq 1 ]; then + opts=$(lb totp ls) + fi ;; esac fi