Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed screen width issue under solaris -- tput now works

git-svn-id: http://shflags.googlecode.com/svn/trunk/source/1.0@85 9d7cb843-df4f-0410-8a79-4785ae5a3405
  • Loading branch information...
commit 335171e844bad3ec8130ce58275571afae377cbe 1 parent 24c41aa
kate.ward@forestent.com authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 src/shflags
9 src/shflags
View
@@ -451,12 +451,11 @@ _flags_screenColumns()
if _flags_size_=`stty size 2>/dev/null`; then
# stty size worked :-)
_flags_cols_=`expr "${_flags_size_}" : '[0-9]* \([0-9]*\)'`
- elif _flags_cols_=`tput cols 2>/dev/null`; then
- # TODO(kward): this doesn't actaully work... tput is executed within a
- # sub-shell which causes the screen width to be lost.
- : # tput worked :-)
+ elif eval tput cols >/dev/null 2>&1; then
+ set -- `tput cols`
+ _flags_cols_=$1
else
- _flags_cols_=80
+ _flags_cols_=80 # default terminal width
fi
echo ${_flags_cols_}
unset _flags_cols_ _flags_size_
Please sign in to comment.
Something went wrong with that request. Please try again.