-
Notifications
You must be signed in to change notification settings - Fork 13
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
Support configuration file for export command #55
base: main
Are you sure you want to change the base?
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 : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -27,6 +28,7 @@ var includeContainers bool | |||
var orgs []uint | |||
|
|||
func init() { | |||
exportCmd.Flags().StringVar(&config, "config", "", "Location of configuration file") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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: