You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: checkenv.go
+12-3Lines changed: 12 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,7 @@ func main() {
69
69
showExport:=showFlags.Bool("export", false, "Use this flag to prepend and \"export \" before every environment variable definition")
70
70
showRaw:=showFlags.Bool("raw", false, "Use this flag to prevent comments output")
71
71
showValue:=showFlags.Bool("value", false, "Print value only")
72
+
showName:=showFlags.Bool("name", false, "Print name only")
72
73
73
74
versionCommand:="version"
74
75
@@ -98,12 +99,18 @@ func main() {
98
99
fmt.Fprintf(os.Stderr, "Usage: %s %s [<provider_name>[+<provider_args>] ...] [<provider_name>[+<provider_args>]://<var_name_1>,<var_name_2>,...,<var_name_n> ...]\nShows the environment variables defined by the given providers.\n", os.Args[0], os.Args[1])
99
100
os.Exit(2)
100
101
}
102
+
103
+
if*showName&&*showValue {
104
+
fmt.Fprintf(os.Stderr, "You can't use both -name and -value flags at the same time.\n")
0 commit comments