Skip to content

Commit

Permalink
config: Support DCRD_APPDATA env variable.
Browse files Browse the repository at this point in the history
This modifies the config parsing to use the DCRD_APPDATA environment
variable to override the overall application data directory as an
alternative to the --appdata CLI option.

Note that the --appdata CLI option takes precedence over the environment
variable if both are specified.

Environment variables are generally the preferred approach for
overriding defaults in containers.
  • Loading branch information
davecgh committed Jun 29, 2023
1 parent 39e2cc2 commit 216132d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ var runServiceCommand func(string) error
type config struct {
// General application behavior.
ShowVersion bool `short:"V" long:"version" description:"Display version information and exit"`
HomeDir string `short:"A" long:"appdata" description:"Path to application home directory"`
HomeDir string `short:"A" long:"appdata" description:"Path to application home directory" env:"DCRD_APPDATA"`
ConfigFile string `short:"C" long:"configfile" description:"Path to configuration file"`
DataDir string `short:"b" long:"datadir" description:"Directory to store data"`
LogDir string `long:"logdir" description:"Directory to log output"`
Expand Down

0 comments on commit 216132d

Please sign in to comment.