-
Notifications
You must be signed in to change notification settings - Fork 348
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 TryAddFlagSet and EnvVars and AddFlag #333
base: master
Are you sure you want to change the base?
Conversation
f3c7d68
to
9df3e45
Compare
It looks like it is not showing correctly the default value
Extract from my source code
|
sval = envVal | ||
} else { | ||
sval = flag.Value.String() | ||
} |
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.
When the both the flag value and the env var are specified, the flag value should be prioritized over the env value
Could you update the commit messages to be more descriptive? |
@robberphex do you plan to move forward on this? |
nerdctl now uses unforked cobra, so this PR is no longer needed from nerdctl perspective. |
thanks @AkihiroSuda |
AddFlag
.originally, AddFlag can accept a
pflag.Flag
, but user cannot buildValue
field forpflag.Flag
. So I renamepflag.newStringValue
topflag.NewStringValue
to makeAddFlag
usable, for example: