29 lines
426 B
Go
29 lines
426 B
Go
//
|
|
// cli_base.go
|
|
// Copyright (C) 2022 tiglog <me@tiglog.com>
|
|
//
|
|
// Distributed under terms of the MIT license.
|
|
//
|
|
|
|
package console
|
|
|
|
import "flag"
|
|
|
|
type BaseCmd struct {
|
|
Name string
|
|
Desc string
|
|
FlagSet *flag.FlagSet
|
|
Action ActionHandler
|
|
}
|
|
|
|
func (c *BaseCmd) GetName() string {
|
|
return c.Name
|
|
}
|
|
func (c *BaseCmd) GetDesc() string {
|
|
return c.Desc
|
|
}
|
|
|
|
func (c *BaseCmd) GetAction() ActionHandler {
|
|
return c.Action
|
|
}
|