Support configuration file for export command#55
Support configuration file for export command#55WordlessEcho wants to merge 18 commits intouyuni-project:mainfrom
Conversation
- `options.ServerConfig`: /etc/rhn/rhn.conf - `options.OutputFolder`: .
Use utils/utils.GetAbsPath to get path
The path of version.txt can be modified by SetOptionsByConfig()
|
About 5be4e6d : |
avshiliaev
left a comment
There was a problem hiding this comment.
I like your proposal, we could definitely improve it a bit and include into our project if you'd like top work on it.
cmd/export.go
Outdated
| var orgs []uint | ||
|
|
||
| func init() { | ||
| exportCmd.Flags().StringVar(&config, "config", "", "Location of configuration file") |
There was a problem hiding this comment.
That's a nice approach. I'd like it to be a bit more explicit on the user interface level, that we for example can either provide a config or specify it as a set of args. This way we could probably not mix them together with the options. What do you think?
There was a problem hiding this comment.
@avshiliaev Sorry. I didn't catch your point... Can you give me some examples?
Or I guess that you hope the --config could be global flag as same as --serverConfig?
|
I found some bug in recent commits. Waiting for fix. |
Parse []uint by json.Unmarshal spf13/viper#926
|
Bug fixed. |
Resolves #54
If both command parameters and configuration file is specified. It will respect the options of command parameters.
Improvement: Maybe we should make default value of command parameters as constant?
Tested on my environment by following configurations:
~/config.json
Result: