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
@@ -307,7 +307,7 @@ $ tea release create v1.1.0-rc1 --target release/1.1 --draft --prerelease --titl
|
||||
command.Flags().StringVar(&fields.tag, "tag", "", "Release tag")
|
||||
_ = command.Flags().MarkHidden("tag")
|
||||
command.Flags().StringSliceVar(&assets, "asset", nil, "File to upload as an asset (repeatable)")
|
||||
command.ValidArgsFunction = a.completeTags()
|
||||
command.ValidArgsFunction = pathArgs(1, true, completeFiles, a.completeTags())
|
||||
return command
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user