add config option to initialize automaticaly without prompt
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package service
|
||||
|
||||
type Config struct {
|
||||
AutoInit bool
|
||||
RootCmd string
|
||||
WebAddress string
|
||||
BeadsDBPath string
|
||||
@@ -9,6 +10,7 @@ type Config struct {
|
||||
}
|
||||
|
||||
var BaseConfig = Config{
|
||||
AutoInit: false,
|
||||
RootCmd: "pm",
|
||||
IssuePrefix: "pm",
|
||||
WebAddress: ":8080",
|
||||
@@ -16,6 +18,11 @@ var BaseConfig = Config{
|
||||
StatisticsStoragePath: "./.pm/stats.json",
|
||||
}
|
||||
|
||||
func (c Config) WithAutoInit(autoInit bool) Config {
|
||||
c.AutoInit = autoInit
|
||||
return c
|
||||
}
|
||||
|
||||
func (c Config) WithRootCmd(rootCmd string) Config {
|
||||
c.RootCmd = rootCmd
|
||||
return c
|
||||
|
||||
Reference in New Issue
Block a user