]> Nutra Git (v2) - gamesguru/git-remote-gcrypt.git/commitdiff
wip completions
authorShane Jaroch <chown_tee@proton.me>
Thu, 8 Jan 2026 23:02:35 +0000 (18:02 -0500)
committerShane Jaroch <chown_tee@proton.me>
Thu, 8 Jan 2026 23:02:35 +0000 (18:02 -0500)
completions/bash/git-remote-gcrypt
completions/fish/git-remote-gcrypt.fish
completions/gen_docs.py
completions/zsh/_git-remote-gcrypt

index 4e46442763c64b1e3d65a0031ad2c4941ee6b4a6..96f4b04fa2999230bac0554a58af95dc4531180a 100644 (file)
@@ -7,7 +7,7 @@ _git_remote_gcrypt() {
        cur="${COMP_WORDS[COMP_CWORD]}"
        prev="${COMP_WORDS[COMP_CWORD - 1]}"
        opts="-h --help -v --version --check"
-       commands="capabilities check clean fetch list push"
+       commands="check clean"
 
        # 1. First argument: complete commands and global options
        if [[ $COMP_CWORD -eq 1 ]]; then
index c8f4636f3c11c8b7e832388694035bc1de72d1e6..48bc49d0de16baaaf5a35788fe05f2116e2d098c 100644 (file)
@@ -6,15 +6,15 @@ complete -c git-remote-gcrypt -s v -l version -d 'Show version information'
 complete -c git-remote-gcrypt -l check -d '(Legacy) Check if URL is a gcrypt repository' -r -F
 
 # Subcommands
-complete -c git-remote-gcrypt -f -n "not __fish_seen_subcommand_from capabilities check clean fetch list push" -a 'check' -d 'Check if URL is a gcrypt repository'
-complete -c git-remote-gcrypt -f -n "not __fish_seen_subcommand_from capabilities check clean fetch list push" -a 'clean' -d 'Scan/Clean unencrypted files from remote'
+complete -c git-remote-gcrypt -f -n "not __fish_seen_subcommand_from check clean" -a 'check' -d 'Check if URL is a gcrypt repository'
+complete -c git-remote-gcrypt -f -n "not __fish_seen_subcommand_from check clean" -a 'clean' -d 'Scan/Clean unencrypted files from remote'
 complete -c git-remote-gcrypt -n "__fish_seen_subcommand_from clean check" -a "(git remote -v 2>/dev/null | grep 'gcrypt::' | awk '{print \$1}' | sort -u)" -d 'Gcrypt Remote'
 
 # Clean flags
-complete -c git-remote-gcrypt -f -n "__fish_seen_subcommand_from capabilities check clean fetch list push" -s f -l force -d 'Actually delete files during clean'
+complete -c git-remote-gcrypt -f -n "__fish_seen_subcommand_from check clean" -s f -l force -d 'Actually delete files during clean'
 
 # Git protocol commands
-complete -c git-remote-gcrypt -f -n "not __fish_seen_subcommand_from capabilities check clean fetch list push" -a 'capabilities' -d 'Show git remote helper capabilities'
-complete -c git-remote-gcrypt -f -n "not __fish_seen_subcommand_from capabilities check clean fetch list push" -a 'list' -d 'List refs in remote repository'
-complete -c git-remote-gcrypt -f -n "not __fish_seen_subcommand_from capabilities check clean fetch list push" -a 'push' -d 'Push refs to remote repository'
-complete -c git-remote-gcrypt -f -n "not __fish_seen_subcommand_from capabilities check clean fetch list push" -a 'fetch' -d 'Fetch refs from remote repository'
+complete -c git-remote-gcrypt -f -n "not __fish_seen_subcommand_from check clean" -a 'capabilities' -d 'Show git remote helper capabilities'
+complete -c git-remote-gcrypt -f -n "not __fish_seen_subcommand_from check clean" -a 'list' -d 'List refs in remote repository'
+complete -c git-remote-gcrypt -f -n "not __fish_seen_subcommand_from check clean" -a 'push' -d 'Push refs to remote repository'
+complete -c git-remote-gcrypt -f -n "not __fish_seen_subcommand_from check clean" -a 'fetch' -d 'Fetch refs from remote repository'
index 217a731256abbe0946240c3f4ef7c96c180a32d3..df7405c5e47aab22785b81783ff0d53f77689b6a 100755 (executable)
@@ -22,10 +22,14 @@ def parse_commands(help_text):
     capture = False
     for line in lines:
         line = line.strip()
-        if line.startswith("Options:") or line.startswith("Git Protocol Commands"):
+
+        # Filter out what we don't want in tab completion
+        if line.startswith("Options:"):
             capture = True
             continue
-        if line.startswith("Environment Variables:"):
+        if line.startswith("Git Protocol Commands") or line.startswith(
+            "Environment Variables:"
+        ):
             capture = False
             continue
 
@@ -110,10 +114,8 @@ def main():
     help_text = extract_help_text(script_path)
     commands = parse_commands(help_text)
 
-    # We always want protocol commands in completions too
-    comp_commands = sorted(
-        list(set(commands + ["capabilities", "list", "push", "fetch"]))
-    )
+    # Optional: remove (or add) any custom preferences here
+    comp_commands = commands
 
     print(f"Detected commands: {' '.join(comp_commands)}")
 
index 0fe728bf95518d6dd767a36d3b8d4676c8c6e665..e49259b830f58eeb7cf87b97b767504040f0408e 100644 (file)
@@ -8,7 +8,7 @@ _git_remote_gcrypt() {
                '(- *)'{-h,--help}'[show help message]'
                '(- *)'{-v,--version}'[show version information]'
                '--check[check if URL is a gcrypt repository]:URL:_files'
-               '1:command:(capabilities check clean fetch list push)'
+               '1:command:(check clean)'
                '*::subcommand arguments:->args'
        )
        _arguments -s -S $args