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
@@ -54,6 +54,6 @@ $ tea milestone %[1]s v1.0 v1.1`, verb), Annotations: map[string]string{"tea.arg
|
||||
return errors.Join(append(failures, writeBatchJSON(a, cmd, len(selected), results))...)
|
||||
}}
|
||||
cmd.Flags().BoolVar(&byName, "by-name", false, "Match numeric arguments as milestone titles rather than IDs")
|
||||
cmd.ValidArgsFunction = a.completeMilestoneArgs(true)
|
||||
cmd.ValidArgsFunction = a.completeMilestones()
|
||||
return cmd
|
||||
}
|
||||
Reference in new issue
Block a user