v1.0.0
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
// Flags contains command-line options accepted by est.
|
||||
type Flags struct {
|
||||
ConfigPath string
|
||||
}
|
||||
|
||||
// ParseFlags parses est command-line flags.
|
||||
func ParseFlags() (*Flags, error) {
|
||||
configPath := pflag.StringP("config", "c", "./config.toml", "toml config path")
|
||||
pflag.Parse()
|
||||
if configPath == nil {
|
||||
return nil, errors.New("no config path")
|
||||
}
|
||||
return &Flags{ConfigPath: *configPath}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user