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:
bircni committed 2026-10-12 10:50:37 +02:00
1 parent 1f4b5f868f
commit 9ac5b79e9e
22 files changed
+75 -212

No files matched your search

+1 -1
View File
@@ -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
}