update completions
authorShane Jaroch <chown_tee@proton.me>
Wed, 14 Jan 2026 17:19:57 +0000 (12:19 -0500)
committerShane Jaroch <chown_tee@proton.me>
Wed, 14 Jan 2026 17:24:10 +0000 (12:24 -0500)
completions/bash/git-remote-gcrypt
completions/templates/bash.in
completions/templates/zsh.in
completions/zsh/_git-remote-gcrypt
utils/gen_docs.sh

index a4d279eb34b14133a5edc0dc54eb2ec938c7af56..baf07157aef4412a4fe2a23c7bc73826cc94a92a 100644 (file)
@@ -21,12 +21,12 @@ _git_remote_gcrypt() {
        # 2. Handle subcommands
        case "${COMP_WORDS[1]}" in
                clean)
-                       local remotes=$(git remote -v 2>/dev/null | grep 'gcrypt::' | awk '{print $1}' | sort -u || :
+                       local remotes=$(git remote -v 2>/dev/null | grep 'gcrypt::' | awk '{print $1}' | sort -u || :)
                        COMPREPLY=($(compgen -W " $remotes" -- "$cur"))
                        return 0
                        ;;
                check)
-                       local remotes=$(git remote 2>/dev/null || :
+                       local remotes=$(git remote 2>/dev/null || :)
                        COMPREPLY=($(compgen -W "$remotes" -- "$cur"))
                        return 0
                        ;;
index d13292782f66022c31a756f204189d0801d230b5..32956add259c1da1905b6c951dd9b9ded4ceb4a6 100644 (file)
@@ -21,12 +21,12 @@ _git_remote_gcrypt() {
        # 2. Handle subcommands
        case "${COMP_WORDS[1]}" in
                clean)
-                       local remotes=$(git remote -v 2>/dev/null | grep 'gcrypt::' | awk '{print $1}' | sort -u || :
+                       local remotes=$(git remote -v 2>/dev/null | grep 'gcrypt::' | awk '{print $1}' | sort -u || :)
                        COMPREPLY=($(compgen -W "{clean_flags_bash} $remotes" -- "$cur"))
                        return 0
                        ;;
                check)
-                       local remotes=$(git remote 2>/dev/null || :
+                       local remotes=$(git remote 2>/dev/null || :)
                        COMPREPLY=($(compgen -W "$remotes" -- "$cur"))
                        return 0
                        ;;
index b357d1f4bbf5cf92ef24845e221880e1c207b7ec..329bdb134c9454ae3544544a93ea70037f59914b 100644 (file)
@@ -15,7 +15,6 @@ _git_remote_gcrypt() {
        case $line[1] in
        clean)
                _arguments \
-                       {clean_flags_zsh} \
                        '*:gcrypt URL: _alternative "remotes:gcrypt remote:($(git remote -v 2>/dev/null | grep "gcrypt::" | awk "{print \$1}" | sort -u))" "files:file:_files"'
                ;;
        check)
index d937362b2160da09d8172a0fb487a9fc12d2008a..ceb5ae59511ef12eac8557dd2cdd1131e1855e95 100644 (file)
@@ -15,7 +15,6 @@ _git_remote_gcrypt() {
        case $line[1] in
        clean)
                _arguments \
-                       '()' {} '[flag]' \
                        '*:gcrypt URL: _alternative "remotes:gcrypt remote:($(git remote -v 2>/dev/null | grep "gcrypt::" | awk "{print \$1}" | sort -u))" "files:file:_files"'
                ;;
        check)
index 878ccc2639095446e7dd9bfe6ed22767d4f087be..eab2ba7673ad164c47e1ec905f77cfbd2aadd02a 100755 (executable)
@@ -47,10 +47,13 @@ CLEAN_FLAGS_BASH=$(echo "$CLEAN_FLAGS_RAW" | tr '\n' ' ' | sed 's/ $//')
 CLEAN_FLAGS_ZSH=""
 # We'll just provide the flags as a list for _arguments
 # ZSH format roughly: '(-f --force)'{-f,--force}'[desc]'
-# Let's simplify and just pass the flags for now to match the user's "native completion" request without over-engineering the parsing in shell.
-# We will just list them.
+# Only generate if there are actual flags
 COMMA_FLAGS=$(echo "$CLEAN_FLAGS_BASH" | tr ' ' ',')
-CLEAN_FLAGS_ZSH="'(${CLEAN_FLAGS_BASH})' {${COMMA_FLAGS}} '[flag]'"
+if [ -n "$CLEAN_FLAGS_BASH" ]; then
+       CLEAN_FLAGS_ZSH="'(${CLEAN_FLAGS_BASH})' {${COMMA_FLAGS}} '[flag]'"
+else
+       CLEAN_FLAGS_ZSH=""
+fi
 
 # For Fish
 # We need to turn "-f, --force" into: