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’ll 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

@jsteenb2 jsteenb2 requested a review from gitirabassi June 17, 2020 16:30
@jsteenb2 jsteenb2 force-pushed the 18565/cli_config_files branch from fd7cb70 to a393bb5 Compare June 17, 2020 16:32
@jsteenb2 jsteenb2 requested a review from stuartcarnie June 17, 2020 16:34
kit/cli/viper.go Outdated Show resolved Hide resolved
@jsteenb2 jsteenb2 force-pushed the 18565/cli_config_files branch from a393bb5 to a581a6c Compare June 17, 2020 16:44
// 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

@jsteenb2 jsteenb2 force-pushed the 18565/cli_config_files branch from a581a6c to 62f2a93 Compare June 17, 2020 16:51
@jsteenb2 jsteenb2 requested a review from bthesorceror June 17, 2020 16:51
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