-
-
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
Colorful help (#340) and some help refactoring #3541
Conversation
This allows custom command ordering and subcommand groups. License: MIT Signed-off-by: Julian Dax <julian.dax@me.com>
374df2e
to
4411faa
Compare
Commands can now have groups and are listed under these groups. The output of $ipfs is also not longer using the `Subcommands` override. License: MIT Signed-off-by: Julian Dax <julian.dax@me.com>
License: MIT Signed-off-by: Julian Dax <julian.dax@me.com>
License: MIT Signed-off-by: Julian Dax <julian.dax@me.com>
License: MIT Signed-off-by: Julian Dax <julian.dax@uni-siegen.de>
License: MIT Signed-off-by: Julian Dax <julian.dax@uni-siegen.de>
81dc4d4
to
cfeacdd
Compare
License: MIT Signed-off-by: Julian Dax <julian.dax@uni-siegen.de>
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.
Hey @brodo, Thanks for the PR. I agree, the CLI is a bit... boring.
First off, we definitely want to separate features from refactoring. So the refactor from map to slice in subcommands should be its own PR, adding colors should be its own PR, and the additionalhelp field change needs to be its own PR.
Aside from that, we should find a way to test that the colors are rendering as expected in the sharness tests.
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.
In my opinion the commands can be sorted by name for the display instead of making a map? Is there a case where it wouldn't be enough?
Would it be possible to instead make the Group
string part of the Cmd struct itself instead of introducing new struct?
@@ -4,7 +4,9 @@ import ( | |||
"strings" | |||
"testing" | |||
|
|||
"bytes" |
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.
this package should be joined with those above, this is stdlib package
@whyrusleeping Ok, I'll first divide this PR into three smaller ones. All the other things then can be discussed separately in the three PRs. |
Hello,
this PR is related to issue #340 but also does some other things.
Subcommand
map is now an array ofCmdInfos
HelpText now has an
AdditionalHelp
fieldThere is now a --color command line flag
--color
less -R
)This PR touches a lot of files, but most changes are just simple gofmt transformations in order to switch from the
Subcommand
map to theSubcommand
array.Cheers from 33c3,
Julian