flags : more common help functions, but redefining the subcmds in each package is probably wrong, esp. since last had to be deduped

This commit is contained in:
bth 2026-01-20 13:10:47 -08:00
commit 77e3e23446
5 changed files with 31 additions and 14 deletions

View file

@ -74,6 +74,14 @@ func ValidateIncrementFetchOrExit(args []string, i int) (int, string) {
return i + 1, args[i+1]
}
func HelpRequired(cmd string, long string) {
log.Printf("um %s: %s is required", cmd, long)
}
func HelpInvalidArg(cmd string, arg string) {
log.Printf("um %s: invalid argument: %s", cmd, arg)
}
// print out help string by reflecting over fields of provided opts struct
// and os.Exit(0)
func Help(subcmd string, opts any) {