fix(help): normalize coloring, add doc links#7
Merged
btschwartz12 merged 2 commits intomainfrom Oct 20, 2025
Merged
Conversation
e0a6a19 to
25c9e4e
Compare
btschwartz12
commented
Oct 20, 2025
Contributor
Author
There was a problem hiding this comment.
This CI job was unnecessary to begin with. If we really want something for this, it can be added in the future
btschwartz12
commented
Oct 20, 2025
Comment on lines
+67
to
+79
| if !formatter.StdoutIsTTY() { | ||
| restore := styles.TemporarilyDisableStyles() | ||
| defer restore() | ||
| } | ||
| formatter.Println(formatter.Stdout, rootHelpFunc(formatter.Stdout, cmd)) | ||
| } | ||
|
|
||
| func (c *Command) UsageFunc(cmd *cobra.Command, _ []string) { | ||
| formatter.Println(formatter.Stderr, rootHelpFunc(cmd)) | ||
| if !formatter.StderrIsTTY() { | ||
| restore := styles.TemporarilyDisableStyles() | ||
| defer restore() | ||
| } | ||
| formatter.Println(formatter.Stderr, rootHelpFunc(formatter.Stderr, cmd)) |
Contributor
Author
There was a problem hiding this comment.
This allows you to pipe help output to a file without all the nasty ANSI color sequences
btschwartz12
commented
Oct 20, 2025
|  | ||
|
|
||
| You can also use the `--short` flag to render output using templates, which can be customized. See the [templating documentation](./docs/commands/view.md#templates) for more details. | ||
| You can also use the `--short` flag to render output using templates, which can be customized. See the [templating documentation](./docs/commands/VIEW.md#templates) for more details. |
Contributor
Author
There was a problem hiding this comment.
Fixing a broken link
83a65e5 to
2f397fd
Compare
btschwartz12
commented
Oct 20, 2025
Comment on lines
-96
to
-101
| if cmd.HasAvailableSubCommands() { | ||
| b.WriteString("\n") | ||
| b.WriteString(styles.GlobalStyles.Secondary.Render("Use \"")) | ||
| b.WriteString(styles.GlobalStyles.Signature.Render(cmd.CommandPath() + " [command] --help")) | ||
| b.WriteString(styles.GlobalStyles.Secondary.Render("\" for more information.") + "\n") | ||
| } |
Contributor
Author
There was a problem hiding this comment.
This is redundant
2f397fd to
98b3913
Compare
98b3913 to
054b01f
Compare
oscarv-censys
approved these changes
Oct 20, 2025
oscarv-censys
approved these changes
Oct 20, 2025
mehdimas
approved these changes
Oct 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.