diff options
author | kate.ward <kate.ward@forestent.com> | 2008-11-15 02:00:29 +0000 |
---|---|---|
committer | kate.ward <kate.ward@forestent.com> | 2008-11-15 02:00:29 +0000 |
commit | 2f8a1a1a31a3bc0783375904828aec1d161fefe9 (patch) | |
tree | 927c389726318747bafe35a24d87f53054895be8 /source/1.0/src/shflags | |
parent | 5bdeeff9f01952ebfe8d997d835275bfe0c9c435 (diff) | |
download | shflags-2f8a1a1a31a3bc0783375904828aec1d161fefe9.tar.gz |
fixed screen width issue under solaris -- tput now works
Diffstat (limited to 'source/1.0/src/shflags')
-rw-r--r-- | source/1.0/src/shflags | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/1.0/src/shflags b/source/1.0/src/shflags index 055a93d..4c15b0e 100644 --- a/source/1.0/src/shflags +++ b/source/1.0/src/shflags @@ -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_ |