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
@@ -302,7 +302,7 @@ func (a *application) labelImportCommand(scope labelScope) *cobra.Command {
|
||||
" ;description" and " ;exclusive", " ;archived" or both. tea label export writes this
|
||||
format, and Gitea's label templates use it. Existing labels are refused unless --force
|
||||
updates them.`, Example: `$ tea label import labels.txt
|
||||
$ tea label export --repo alice/old | tea label import - --repo alice/new`, Args: argsExact(1), RunE: func(cmd *cobra.Command, args []string) error {
|
||||
$ tea label export --repo alice/old | tea label import - --repo alice/new`, Args: argsExact(1), ValidArgsFunction: completeFiles, RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return a.importLabels(cmd, scope, args[0], force)
|
||||
}}
|
||||
cmd.Flags().BoolVarP(&force, "force", "f", false, "Update labels that exist already")
|
||||
|
||||
Reference in new issue
Block a user