Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): extend Program with config file #18568

Merged
merged 1 commit into from
Jun 17, 2020
Merged

Conversation

jsteenb2
Copy link
Contributor

@jsteenb2 jsteenb2 commented Jun 17, 2020

adds the ability to provide a config file to Programs when using the NewCommand constructor 馃憤

closes: #18565

kit/cli/viper.go Outdated Show resolved Hide resolved
// 2. env vars
// 3. config file
if err := initializeConfig(); err != nil {
panic(fmt.Sprintf("invalid config file[%s] caused panic: %s", configFile, err))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the panic here is purposepul, if you provide a config, and it is janky, we're gonna explode

Copy link
Contributor

@stuartcarnie stuartcarnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid stuff!

@jsteenb2 jsteenb2 force-pushed the 18565/cli_config_files branch 2 times, most recently from 193d6b7 to 1c2cdb5 Compare June 17, 2020 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to load configuration files from kit/cli
2 participants