Skip to content

Commit

Permalink
helptext: lower minimum width to 30, raise width to 100
Browse files Browse the repository at this point in the history
Otherwise, `ipfs daemon --help` and `ipfs p2p --help` look terrible.
  • Loading branch information
Stebalien committed Jan 17, 2019
1 parent f4e8230 commit 79620b6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cli/helptext.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

const (
terminalWidth = 80
terminalWidth = 100
requiredArg = "<%v>"
optionalArg = "[<%v>]"
variadicArg = "%v..."
Expand Down Expand Up @@ -326,9 +326,8 @@ func appendWrapped(prefix, text string, width int) string {
bWidth := width - offset

text = strings.Trim(text, whitespace)
// Let the terminal handle wrapping if it's to small. Otherwise
// we get really small lines.
if bWidth < 40 {
// Minimum help-text width is 30 characters.
if bWidth < 30 {
prefix += text
return prefix
}
Expand Down

0 comments on commit 79620b6

Please sign in to comment.