Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Wrap help flags at 100 chars#2893

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mafredri merged 1 commit intomainfrommafredri/wrap-help-flags
Jul 11, 2022
Merged

Conversation

mafredri
Copy link
Member

Because the actual flags take quite a bit of space, wrapping at 80
characters creates a very cramped output for e.g.coder server, for
this reasons, flags are wrapped at 100 chars (vs. standard 80).

TheConsumes $ENV_FLAG message was put on a newline for consistency,
this should allow users to learn where to look for the informations.

Side note: we should perhaps stop adding period (.) at the end of flag
descriptions to be consistent, for instance, command helps usually don't
have one.

This change fixes the biggest issue in#2363, but not all--help
output is guaranteed (yet) to wrap at 80-100 chars.

Fixes#2363

Because the actual flags take quite a bit of space, wrapping at 80characters creates a very cramped output for e.g. `coder server`, forthis reasons, flags are wrapped at 100 chars (vs. standard 80).The `Consumes $ENV_FLAG` message was put on a newline for consistency,this should allow users to learn where to look for the informations.Side note: we should perhaps stop adding period (`.`) at the end of flagdescriptions to be consistent, for instance, command helps usually don'thave one.This change fixes the biggest issue in#2363, but not all `--help`output is guaranteed (yet) to wrap at 80-100 chars.Fixes#2363
@mafredrimafredri self-assigned thisJul 11, 2022
@mafredrimafredri requested a review froma teamJuly 11, 2022 13:46
@kylecarbs
Copy link
Member

Great change. The non-wrapped text was difficult to read!

mafredri reacted with heart emoji

@@ -348,12 +348,12 @@ func usageTemplate() string {

{{- if .HasAvailableLocalFlags}}
{{usageHeader "Flags:"}}
{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}
{{.LocalFlags.FlagUsagesWrapped 100}}
Copy link
Member

Choose a reason for hiding this comment

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

TIL 👍

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Same here, we havepflag to thank ❤️! 😄

@mafredrimafredri merged commitc768137 intomainJul 11, 2022
@mafredrimafredri deleted the mafredri/wrap-help-flags branchJuly 11, 2022 14:07
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@EmyrkEmyrkEmyrk approved these changes

@kylecarbskylecarbskylecarbs approved these changes

Assignees

@mafredrimafredri

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Wrap --help command descriptions at 80 characters
3 participants
@mafredri@kylecarbs@Emyrk

[8]ページ先頭

©2009-2025 Movatter.jp