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

Change log-level from "off" to "never" and show enums in options help #442

Merged
merged 2 commits into from
Feb 12, 2024

Conversation

cretz
Copy link
Member

@cretz cretz commented Feb 12, 2024

What was changed

Change log-level from "off" to "never" and show enums in options help.

@cretz cretz requested a review from a team February 12, 2024 18:05
Copy link
Contributor

@dandavison dandavison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One code suggestion but otherwise LGTM

Comment on lines 323 to 334
// If there are enums, append to desc
desc := c.Desc
if len(c.EnumValues) > 0 {
desc += " Accepted values: "
for i, enumVal := range c.EnumValues {
if i > 0 {
desc += ", "
}
desc += enumVal
}
desc += "."
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// If there are enums, append to desc
desc := c.Desc
if len(c.EnumValues) > 0 {
desc += " Accepted values: "
for i, enumVal := range c.EnumValues {
if i > 0 {
desc += ", "
}
desc += enumVal
}
desc += "."
}
if len(c.EnumValues) > 0 {
c.Desc += fmt.Sprintf(" Accepted values: %s.", strings.Join(c.EnumValues, ", "))
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I did this originally because I had "and" in there and it didn't look right, will change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@cretz cretz merged commit 889cc1f into cli-rewrite Feb 12, 2024
4 checks passed
@cretz cretz deleted the log-level-enum branch February 12, 2024 18:36
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

Successfully merging this pull request may close these issues.

2 participants