{"action":"created","issue":{"url":"https://api.github.com/repos/TeXitoi/structopt/issues/72","repository_url":"https://api.github.com/repos/TeXitoi/structopt","labels_url":"https://api.github.com/repos/TeXitoi/structopt/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/TeXitoi/structopt/issues/72/comments","events_url":"https://api.github.com/repos/TeXitoi/structopt/issues/72/events","html_url":"https://github.com/TeXitoi/structopt/issues/72","id":298217855,"number":72,"title":"Feature-gated config-rs handling","user":{"login":"synek317","id":1183738,"avatar_url":"https://avatars3.githubusercontent.com/u/1183738?v=4","gravatar_id":"","url":"https://api.github.com/users/synek317","html_url":"https://github.com/synek317","followers_url":"https://api.github.com/users/synek317/followers","following_url":"https://api.github.com/users/synek317/following{/other_user}","gists_url":"https://api.github.com/users/synek317/gists{/gist_id}","starred_url":"https://api.github.com/users/synek317/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/synek317/subscriptions","organizations_url":"https://api.github.com/users/synek317/orgs","repos_url":"https://api.github.com/users/synek317/repos","events_url":"https://api.github.com/users/synek317/events{/privacy}","received_events_url":"https://api.github.com/users/synek317/received_events","type":"User","site_admin":false},"labels":[{"id":531110077,"url":"https://api.github.com/repos/TeXitoi/structopt/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-19T10:02:03Z","updated_at":"2018-02-19T13:40:14Z","closed_at":null,"author_association":"NONE","body":"There is great [config-rs](https://github.com/mehcode/config-rs)  crate that provides hierarchical configuration and deserialization into struct. I think it would be great if clap / structopt could handle feature like this. With this, one can handle app configuration that can be provided in multiple config files and/or command line all in one place and with single structure.\r\n\r\nI suggest to add `from_opts_and_config` function that would accept `Config` instance (from config-rs) that would provide defaults when argument is not passed in command line.\r\n\r\nI think that it is a best way because only structopt has full knowledge if and what arguments has been passed and which are mandatory and what should be default value if arg is not passed. Config crate requires that all values are defined, otherwise deserialization returns `Err`.\r\n\r\nOf course config-rs dependency should be configurable with features.\r\n\r\nIf you think it is a good idea, I could prepare some implementation."},"comment":{"url":"https://api.github.com/repos/TeXitoi/structopt/issues/comments/366695847","html_url":"https://github.com/TeXitoi/structopt/issues/72#issuecomment-366695847","issue_url":"https://api.github.com/repos/TeXitoi/structopt/issues/72","id":366695847,"user":{"login":"TeXitoi","id":5787066,"avatar_url":"https://avatars0.githubusercontent.com/u/5787066?v=4","gravatar_id":"","url":"https://api.github.com/users/TeXitoi","html_url":"https://github.com/TeXitoi","followers_url":"https://api.github.com/users/TeXitoi/followers","following_url":"https://api.github.com/users/TeXitoi/following{/other_user}","gists_url":"https://api.github.com/users/TeXitoi/gists{/gist_id}","starred_url":"https://api.github.com/users/TeXitoi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TeXitoi/subscriptions","organizations_url":"https://api.github.com/users/TeXitoi/orgs","repos_url":"https://api.github.com/users/TeXitoi/repos","events_url":"https://api.github.com/users/TeXitoi/events{/privacy}","received_events_url":"https://api.github.com/users/TeXitoi/received_events","type":"User","site_admin":false},"created_at":"2018-02-19T13:40:14Z","updated_at":"2018-02-19T13:40:14Z","author_association":"OWNER","body":"You might be interested in https://github.com/TeXitoi/structopt/issues/32\r\n\r\nStructOpt is just a wrapper above clap. Looking at your proposition, it seems better to include this functionality directly in clap. But you may have some arguments to do it in structopt."}}
{"actor":{"display_login":"TeXitoi"}}