mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-29 07:03:48 +03:00
cmd: rename -env to -envfile and use -env to print the environment (#2517)
* caddy: Rename env flag to envfile * caddy: Add env flag to print environment variables
This commit is contained in:
parent
397d67876c
commit
e6a3e5e1f3
1 changed files with 9 additions and 1 deletions
|
@ -53,7 +53,8 @@ func init() {
|
||||||
flag.StringVar(&disabledMetrics, "disabled-metrics", "", "Comma-separated list of telemetry metrics to disable")
|
flag.StringVar(&disabledMetrics, "disabled-metrics", "", "Comma-separated list of telemetry metrics to disable")
|
||||||
flag.StringVar(&conf, "conf", "", "Caddyfile to load (default \""+caddy.DefaultConfigFile+"\")")
|
flag.StringVar(&conf, "conf", "", "Caddyfile to load (default \""+caddy.DefaultConfigFile+"\")")
|
||||||
flag.StringVar(&cpu, "cpu", "100%", "CPU cap")
|
flag.StringVar(&cpu, "cpu", "100%", "CPU cap")
|
||||||
flag.StringVar(&envFile, "env", "", "Path to file with environment variables to load in KEY=VALUE format")
|
flag.BoolVar(&printEnv, "env", false, "Enable to print environment variables")
|
||||||
|
flag.StringVar(&envFile, "envfile", "", "Path to file with environment variables to load in KEY=VALUE format")
|
||||||
flag.BoolVar(&fromJSON, "json-to-caddyfile", false, "From JSON stdin to Caddyfile stdout")
|
flag.BoolVar(&fromJSON, "json-to-caddyfile", false, "From JSON stdin to Caddyfile stdout")
|
||||||
flag.BoolVar(&plugins, "plugins", false, "List installed plugins")
|
flag.BoolVar(&plugins, "plugins", false, "List installed plugins")
|
||||||
flag.StringVar(&certmagic.Email, "email", "", "Default ACME CA account email address")
|
flag.StringVar(&certmagic.Email, "email", "", "Default ACME CA account email address")
|
||||||
|
@ -117,6 +118,12 @@ func Run() {
|
||||||
mustLogFatalf("%v", err)
|
mustLogFatalf("%v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if printEnv {
|
||||||
|
for _, v := range os.Environ() {
|
||||||
|
fmt.Println(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// initialize telemetry client
|
// initialize telemetry client
|
||||||
if EnableTelemetry {
|
if EnableTelemetry {
|
||||||
err := initTelemetry()
|
err := initTelemetry()
|
||||||
|
@ -580,6 +587,7 @@ var (
|
||||||
toJSON bool
|
toJSON bool
|
||||||
version bool
|
version bool
|
||||||
plugins bool
|
plugins bool
|
||||||
|
printEnv bool
|
||||||
validate bool
|
validate bool
|
||||||
disabledMetrics string
|
disabledMetrics string
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue