Skip to content
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

Can't override defaults in slice flags? #258

Closed
wrouesnel opened this issue Jul 10, 2015 · 3 comments
Closed

Can't override defaults in slice flags? #258

wrouesnel opened this issue Jul 10, 2015 · 3 comments
Labels
kind/bug describes or fixes a bug

Comments

@wrouesnel
Copy link

Slice flags seem to have somewhat counter-intuitive behavior (or at least not specifiable).

I want to specify a default slice which is a known safe (or failsafe), but also want to allow the user to override it and specify a whole bunch of elements.

But if I do something like this:

cli.StringSliceFlag {
            Name: "management-socket",
            Value: &cli.StringSlice{"unix:///var/run/log_processor.socket",},
            Usage: "Sockets (unix:// or tcp://) on which to serve the management interface",
        },

Then what I get instead is that when I specify a command line option for that parameter - i.e.
--management-socket tcp://0.0.0.0:8080 then that just gets appended to the default slice, rather then replacing it.

@jszwedko
Copy link
Contributor

Yeah, this is definitely unexpected behavior.

@jszwedko jszwedko added the kind/bug describes or fixes a bug label Aug 12, 2015
@pjvds
Copy link

pjvds commented Sep 30, 2015

Duplicate of #160

@jszwedko
Copy link
Contributor

jszwedko commented May 3, 2016

Indeed, closing in lieu of #160 -- #350 should address it though.

@jszwedko jszwedko closed this as completed May 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug describes or fixes a bug
Projects
None yet
Development

No branches or pull requests

3 participants