read a section of config (#255)
This commit is contained in:
committed by
Robbie Zhang
parent
50ffc04ab2
commit
39c6654dd8
5
root.go
5
root.go
@@ -67,6 +67,11 @@ func Execute() {
|
|||||||
func init() {
|
func init() {
|
||||||
cobra.OnInitialize(initConfig)
|
cobra.OnInitialize(initConfig)
|
||||||
|
|
||||||
|
// read default node name from environment variable.
|
||||||
|
// it can be overwritten by cli flags if specified.
|
||||||
|
if os.Getenv("DEFAULT_NODE_NAME") != "" {
|
||||||
|
nodeName = os.Getenv("DEFAULT_NODE_NAME")
|
||||||
|
}
|
||||||
// Here you will define your flags and configuration settings.
|
// Here you will define your flags and configuration settings.
|
||||||
// Cobra supports persistent flags, which, if defined here,
|
// Cobra supports persistent flags, which, if defined here,
|
||||||
// will be global for your application.
|
// will be global for your application.
|
||||||
|
|||||||
Reference in New Issue
Block a user