You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
398 B

6 years ago
package main
import (
"os"
6 years ago
common "source.heropunch.io/tomo/go-coreutils"
6 years ago
)
func main() {
if len(os.Args) == 1 {
6 years ago
common.PrintEnv()
6 years ago
os.Exit(0)
}
exitCode := 0
envVars := []string{}
for _, key := range os.Args[1:] {
val, present := os.LookupEnv(key)
if present {
envVars = append(envVars, val)
} else {
exitCode = 1
}
}
6 years ago
common.PrintStrings(envVars)
6 years ago
os.Exit(exitCode)
}