package env // this is an experiment at this point to // see how this turns out func Verbose() bool { // always use the ENV value first if envPB != nil { found := envPB.FindByVar("Verbose") if found == nil { // Verbose isn't in the ENV. do nothing here } else { // return what the ENV has // fmt.Println("returning from the ENV:" + found.Value) if found.Value == "true" { return true } return false } } // nothing in the ENV. check argv for _, v := range argv { if v == "--verbose" { return true } } return false } func If(key string) bool { // always use the ENV value first if envPB != nil { found := envPB.FindByVar(key) if found == nil { // Verbose isn't in the ENV. do nothing here } else { // return what the ENV has // fmt.Println("returning from the ENV:" + found.Value) if found.Value == "true" { return true } return false } } // nothing in the ENV. check argv // todo: turn key to lowercase and check here for _, v := range argv { if v == "--verbose" { return true } } return false }