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
@@ -154,7 +154,7 @@ $ tea release upload v1.0.0 dist/tea-linux --clobber`,
|
||||
}
|
||||
command.Flags().StringVar(&name, "name", "", "Asset name (default: the file's name)")
|
||||
command.Flags().BoolVar(&clobber, "clobber", false, "Replace assets with the same name")
|
||||
command.ValidArgsFunction = a.completeReleases()
|
||||
command.ValidArgsFunction = pathArgs(1, true, completeFiles, a.completeReleases())
|
||||
return command
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user