-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 <[email protected]>
I've added: Synopsis, shortDescription, and longDescription for stats and stats bw. I also added default(false) for poll and default("1s") for interval, and modified the logic to make it fit. Part of #2484 and #2647. License: MIT Signed-off-by: Richard Littauer <[email protected]>
Not sure about the switch statement. There may be a more elegant solution. Part of #2484 License: MIT Signed-off-by: Richard Littauer <[email protected]>
I've added: Synopsis, shortDescription, and longDescription for stats and stats bw. I also added default(false) for poll and default("1s") for interval, and modified the logic to make it fit. Part of #2484 and #2647. License: MIT Signed-off-by: Richard Littauer <[email protected]>
I've added: Synopsis, shortDescription, and longDescription for stats and stats bw. I also added default(false) for poll and default("1s") for interval, and modified the logic to make it fit. Part of #2484 and #2647. License: MIT Signed-off-by: Richard Littauer <[email protected]>
I've added: Synopsis, shortDescription, and longDescription for stats and stats bw. I also added default(false) for poll and default("1s") for interval, and modified the logic to make it fit. Part of #2484 and #2647. License: MIT Signed-off-by: Richard Littauer <[email protected]>
Part of #2484 License: MIT Signed-off-by: Richard Littauer <[email protected]>
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 <[email protected]>
I've added: Synopsis, shortDescription, and longDescription for stats and stats bw. I also added default(false) for poll and default("1s") for interval, and modified the logic to make it fit. Part of #2484 and #2647. License: MIT Signed-off-by: Richard Littauer <[email protected]>
I've added: Synopsis, shortDescription, and longDescription for stats and stats bw. I also added default(false) for poll and default("1s") for interval, and modified the logic to make it fit. Part of #2484 and #2647. License: MIT Signed-off-by: Richard Littauer <[email protected]>
Not sure about the switch statement. There may be a more elegant solution. Part of #2484 License: MIT Signed-off-by: Richard Littauer <[email protected]>
Part of #2484. License: MIT Signed-off-by: Richard Littauer <[email protected]>
Part of #2484 License: MIT Signed-off-by: Richard Littauer <[email protected]>
Split from #2484. License: MIT Signed-off-by: Richard Littauer <[email protected]>
Split from #2484. License: MIT Signed-off-by: Richard Littauer <[email protected]>
I've added: Synopsis, shortDescription, and longDescription for stats and stats bw. I also added default(false) for poll and default("1s") for interval, and modified the logic to make it fit. Part of #2484 and #2647. License: MIT Signed-off-by: Richard Littauer <[email protected]>
Part of #2484 License: MIT Signed-off-by: Richard Littauer <[email protected]>
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 <[email protected]>
Part of #2484 License: MIT Signed-off-by: Richard Littauer <[email protected]>
Part of #2484 License: MIT Signed-off-by: Richard Littauer <[email protected]>
Part of #2484 License: MIT Signed-off-by: Richard Littauer <[email protected]> and License: MIT Signed-off-by: Jakub Sztandera <[email protected]>
Part of #2484 License: MIT Signed-off-by: Jakub Sztandera <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Also fixed up a few spelling errors and mistypes, here and there. Got everything I could find.
License: MIT
Signed-off-by: Richard Littauer [email protected]