Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Terminal Columns aren't always available #3

Merged
merged 1 commit into from

2 participants

@fabiokung

In my case (OS X 10.8.2 + iTerm2) getTerminalColumns() returns always 0.

This is a simple change to make it safer and assume 80 when a better value isn't available. Most unix tools do something similar.

@jessevdk jessevdk merged commit 72a6b93 into jessevdk:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 0 deletions.
  1. +3 −0  help.go
View
3  help.go
@@ -109,6 +109,9 @@ func (p *Parser) WriteHelp(writer io.Writer) {
maxlen := maxlonglen + 4
termcol := getTerminalColumns()
+ if termcol <= 0 {
+ termcol = 80
+ }
for _, grp := range p.Groups {
wr.WriteString("\n")
Something went wrong with that request. Please try again.