Open robberphex opened 3 years ago
@robberphex
It looks like it is not showing correctly the default value
-l, --leaderElection Use leader election for the conroller manager. (default ) [$LEADER_ELECTION]
Extract from my source code
leaderElection := new(bool)
rootCmd.PersistentFlags().AddFlag(&pflag.Flag{
Name: "leaderElection",
Shorthand: "l",
Usage: "Use leader election for the conroller manager.",
EnvVars: []string{"LEADER_ELECTION"},
Value: pflag.NewBoolValue(false, leaderElection),
}
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. https://github.com/containerd/nerdctl/pull/524
thanks @AkihiroSuda
AddFlag
. originally, AddFlag can accept apflag.Flag
, but user cannot buildValue
field forpflag.Flag
. So I renamepflag.newStringValue
topflag.NewStringValue
to makeAddFlag
usable, for example: