diff options
author | kate.ward <kate.ward@forestent.com> | 2008-11-14 18:23:03 +0000 |
---|---|---|
committer | kate.ward <kate.ward@forestent.com> | 2008-11-14 18:23:03 +0000 |
commit | 709c13485a388e5dcc86eae54edb0e984187e98f (patch) | |
tree | 3f3f9939f08cc1e47f3addb69a00ccce641dc65b /source/1.0/src | |
parent | 9b0568f60b52d8fe14e65eb54b5635a9f541d5ba (diff) | |
download | shflags-709c13485a388e5dcc86eae54edb0e984187e98f.tar.gz |
added tput code, but it doesn't work really :-(
Diffstat (limited to 'source/1.0/src')
-rw-r--r-- | source/1.0/src/shflags | 10 | ||||
-rwxr-xr-x | source/1.0/src/shflags_test_public.sh | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/source/1.0/src/shflags b/source/1.0/src/shflags index 33a282a..055a93d 100644 --- a/source/1.0/src/shflags +++ b/source/1.0/src/shflags @@ -448,12 +448,14 @@ _flags_itemInList() # integer: width in columns of the current screen. _flags_screenColumns() { - _flags_size_=`stty size 2>/dev/null` - if [ $? -eq ${FLAGS_TRUE} ]; then + 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 :-) else - # TODO(kward): support 'tput cols' as well, if possible. be warned that it - # doesn't work when put inside backticks (i.e. a sub-shell). _flags_cols_=80 fi echo ${_flags_cols_} diff --git a/source/1.0/src/shflags_test_public.sh b/source/1.0/src/shflags_test_public.sh index c635256..03bb39f 100755 --- a/source/1.0/src/shflags_test_public.sh +++ b/source/1.0/src/shflags_test_public.sh @@ -135,6 +135,10 @@ testNoHelp() oneTimeSetUp() { th_oneTimeSetUp + + if [ ${__FLAGS_GETOPT_VERS} -eq ${__FLAGS_GETOPT_VERS_STD} ]; then + th_warn 'Standard version of getopt found. Some tests will be skipped.' + fi } setUp() |