Consolidate subcommand registration

This commit is contained in:
2021-02-02 18:37:26 -06:00
parent 4e25579718
commit 9360df727a
9 changed files with 176 additions and 215 deletions

View File

@ -1,24 +1,10 @@
package lumecmd
import (
"flag"
"fmt"
"sort"
)
func init() {
RegisterCommand("help", Command{
Func: HelpCmd,
Flags: func() *flag.FlagSet {
fs := flag.NewFlagSet("help", flag.ExitOnError)
return fs
}(),
Use: "<command>",
Short: "Show help for a command",
})
}
func HelpCmd(args CmdArgs) (int, error) {
argv := args.Flags.Args()