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

does it support optional flag? #576

Closed
etsangsplk opened this issue Dec 18, 2016 · 4 comments
Closed

does it support optional flag? #576

etsangsplk opened this issue Dec 18, 2016 · 4 comments

Comments

@etsangsplk
Copy link

There are some options that are not always required, and if not required, a builtin default value is set.
fro example when --optionalflag is not entered
the effect of
somecommand --required 1223
is the same as if entered
somecommand --requiredflag 1223 --optionalflag default345

The documentation is not clear wheterh this is supported or not and if so, how that be used.

@jszwedko
Copy link
Contributor

Hi @etsangsplk,

Required flags are not currently supported, they are all optional and have defaults (the Value field on the structs).

Let me know if this helps!

@shadiakiki1986
Copy link

For my optional flags, I just set it to an empty string by default, and check if the string is not empty to check if the optional flag is set

@jszwedko
Copy link
Contributor

jszwedko commented Feb 4, 2017

Indeed, going to close this in lieu of #85 -- put please reopen if I misunderstood you @etsangsplk

@coilysiren
Copy link
Member

Given that this is from last year, I think I'm comfortable closing it 🙂 feel free to re-open / open a new issue / comment in support if there's still interest here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants