refactor(completion): name path arguments explicitly and share firstArg

The six commands that take a file or directory argument set their
completer directly instead of a Use-line parser wrapping every
command, the first-argument-only wrappers become one firstArg helper,
and only the bash completion help keeps a custom text.

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-12 10:50:37 +02:00
1 parent 1f4b5f868f
commit 9ac5b79e9e
22 files changed
+75 -212

No files matched your search

+1 -1
View File
@@ -284,7 +284,7 @@ $ tea repo clone alice/project -- --branch develop --recurse-submodules`,
command.Flags().IntVarP(&opts.depth, "depth", "d", 0, "Number of commits to fetch (0: full history)")
command.Flags().StringVarP(&opts.upstream, "upstream-remote-name", "u", "upstream", "Remote name for the parent of a fork")
command.Flags().BoolVar(&noUpstream, "no-upstream", false, "Do not add a remote for the parent of a fork")
command.ValidArgsFunction = a.completeRepos()
command.ValidArgsFunction = pathArgs(1, false, completeDirectories, a.completeRepos())
return command
}