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

Define hierarchal configuration support #20

Closed
melriffe opened this issue Sep 25, 2020 · 6 comments
Closed

Define hierarchal configuration support #20

melriffe opened this issue Sep 25, 2020 · 6 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@melriffe
Copy link
Member

Define and document how hammerhead's configuration can be specified and overridden.

This goes from configuration file, environment variables, to command-line arguments, flags, and parameters.

This must be clearly documented.

@melriffe melriffe self-assigned this Sep 25, 2020
@melriffe melriffe added the documentation Improvements or additions to documentation label Sep 25, 2020
@melriffe melriffe added this to the v0.2.0 Release milestone Sep 25, 2020
@melriffe
Copy link
Member Author

The primary influence of my design for configuration is coming from "Build Awesome Command-Line Apps in Ruby 2", Chapter 6. This is a pragmatic programmer's title.

@melriffe
Copy link
Member Author

From what I gleaned from the chapter: after default options are created, merge values from a config file before the command line is parsed.

I thought I read something about the user of ENV variables, but I might be mistaken.

@melriffe
Copy link
Member Author

The question now is: can I use TTY::Config to support the idea of 'default' values and have them replaced before thor and CLI parse the command line?

I suspect the answer is no.

@melriffe
Copy link
Member Author

I also might punt on this specific issue.

Side-Note: I wonder why I can't use a .hammerhead.yml file?

@melriffe
Copy link
Member Author

There is one thing for certain: there are no default values for the Harvest credential information.

Because access to the Harvest API is central to this tool's operation, I feel even more compelled to punt on this issue.

@melriffe
Copy link
Member Author

Maybe the path forward is this:

  • when starting the tool for the first time and no config file exists, create a 'default' one with entries that clearly need to be replaced, and say a configuration file was created
  • support a global option to use a different configuration file

This solves the problem of getting people to create a configuration file, with information on what needs to be set, and how. And it solves the problem I have: needing a configuration file for use that doesn't interfere with development and testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant