mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
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:
22 files changed
+75
-212
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user