@@ -264,7 +264,7 @@ Environments may contain sensitive data.
264
264
265
265
RegisterCommand (Command {
266
266
Name : "adapt" ,
267
- Usage : "--config <path> [--adapter <name>] [--pretty] [--validate]" ,
267
+ Usage : "--config <path> [--adapter <name>] [--pretty] [--validate] [--envfile <path>] " ,
268
268
Short : "Adapts a configuration to Caddy's native JSON" ,
269
269
Long : `
270
270
Adapts a configuration to Caddy's native JSON format and writes the
@@ -276,12 +276,16 @@ for human readability.
276
276
If --validate is used, the adapted config will be checked for validity.
277
277
If the config is invalid, an error will be printed to stderr and a non-
278
278
zero exit status will be returned.
279
+
280
+ If --envfile is specified, an environment file with environment variables in
281
+ the KEY=VALUE format will be loaded into the Caddy process.
279
282
` ,
280
283
CobraFunc : func (cmd * cobra.Command ) {
281
284
cmd .Flags ().StringP ("config" , "c" , "" , "Configuration file to adapt (required)" )
282
285
cmd .Flags ().StringP ("adapter" , "a" , "caddyfile" , "Name of config adapter" )
283
286
cmd .Flags ().BoolP ("pretty" , "p" , false , "Format the output for human readability" )
284
287
cmd .Flags ().BoolP ("validate" , "" , false , "Validate the output" )
288
+ cmd .Flags ().StringSliceP ("envfile" , "" , []string {}, "Environment file(s) to load" )
285
289
cmd .RunE = WrapCommandFuncForCobra (cmdAdaptConfig )
286
290
},
287
291
})
0 commit comments