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:
parent
0ff9e6d9a3
commit
77e3e23446
5 changed files with 31 additions and 14 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue