-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add programatic defaults #2484
Add programatic defaults #2484
Conversation
6edd90a
to
b691e17
Compare
@@ -22,7 +22,7 @@ Lists running and recently run commands. | |||
res.SetOutput(req.InvocContext().ReqLog.Report()) | |||
}, | |||
Options: []cmds.Option{ | |||
cmds.BoolOption("v", "verbose", "print more verbose output"), | |||
cmds.BoolOption("v", "verbose", "print more verbose output").Default(false), |
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.
Is it necessary to add Default(false)
to every boolean option? I think it can be inferred that the default value is false.
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.
They're not always false. We could specify only when default is true? cc @jbenet
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.
Going to assume that yes, we should add Default(false)
from now on. See #2582 (comment)
88459aa
to
6b2f4f2
Compare
@RichardLitt ping. |
6b2f4f2
to
c06c696
Compare
Specifically, to `repo`, `resolve`, `swarm`, and `version`. Part of #2484. License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
Not sure about the switch statement. There may be a more elegant solution. Part of #2484 License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
Part of #2484 License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
Added Default logic per #2484, and also added the local option back in, because it exists in the code and should be shown as helptext, at least. License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
Not sure about the switch statement. There may be a more elegant solution. Part of #2484 License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
Part of #2484. License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
Part of #2484 License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
Split from #2484. License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
Split from #2484. License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
Part of #2484 License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
I didn't bother with Chunker, because I think that is a much wider PR. These should all be solid, though. Redid some of the logic to make it smoother. Part of #2484. License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
Part of #2484 License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
Part of #2484 License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
Part of #2484 License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com> and License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
Part of #2484 License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
I didn't bother with Chunker, because I think that is a much wider PR. These should all be solid, though. Redid some of the logic to make it smoother. Part of #2484. License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
I didn't bother with Chunker, because I think that is a much wider PR. These should all be solid, though. Redid some of the logic to make it smoother. Part of #2484. License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
I didn't bother with Chunker, because I think that is a much wider PR. These should all be solid, though. Redid some of the logic to make it smoother. Part of #2484. License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
Also fixed up a few spelling errors and mistypes, here and there. Got everything I could find.
License: MIT
Signed-off-by: Richard Littauer richard.littauer@gmail.com