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
@@ -40,7 +40,7 @@ $ tea milestone issue list v1.0 --state all --kind issues`, Annotations: map[str
|
||||
enumFlag(list, &opts.State, "state", "s", "open", "Filter by state", "open", "closed", "all")
|
||||
enumFlag(list, &opts.Kind, "kind", "", "all", "List issues, pull requests or both", "issues", "pulls", "all")
|
||||
list.Flags().BoolVar(&byName, "by-name", false, "Match a numeric argument as a milestone title rather than an ID")
|
||||
list.ValidArgsFunction = a.completeMilestoneArgs(false)
|
||||
list.ValidArgsFunction = firstArg(a.completeMilestones())
|
||||
group.AddCommand(list)
|
||||
for _, verb := range []string{"add", "remove"} {
|
||||
var byName bool
|
||||
|
||||
Reference in new issue
Block a user