-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
cli.StringSliceFlag and default value #160
Comments
Mmm this definitely feels unexpected to me. |
EnvVar of StringSlice also has this behavior. |
I also have this issue and also feels this behavior is completely unexpected. Is there any plans on fixing this? I'll see if I can take a stab at it and do a PR too. |
I'd be happy to review a PR for this @huguesalary ! |
I also hava this issue, expect to change this behavior. |
Fixed by #392 (will be released is v2, but you can use that branch for now). |
Hello,
I define my flag as follow:
If I start my binary without arguments,
c.StringSlice("filter")
returns["flag1", "flag2", "flag3"]
as expected.If I start my binary with
--filter flag4
,c.StringSlice("filter")
returns["flag1", "flag2", "flag3", "flag4"]
. I find this behaviour odd, I expected it to erase the default value.Even worst, if I start my binary with
--filter flag1
,c.StringSlice("filter")
returns["flag1", "flag2", "flag3", "flag1"]
.Is this the expected behavior ? I know I have 3 default value so I can do
c.StringSlice("filter")[3:]
if set, but still it's not perfect.The text was updated successfully, but these errors were encountered: