summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtools/checkusage.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/checkusage.sh b/tools/checkusage.sh
index 3d573a253..6cde8fbf6 100755
--- a/tools/checkusage.sh
+++ b/tools/checkusage.sh
@@ -14,6 +14,9 @@ fi
builddir="."
cmds=$(echo $@ | tr ' ' '\n' | sort)
+# set env to dump all output to files
+test -z "$CU_DUMP" || rm -f /tmp/checkusage--{help,version,unknownopt}
+
## Set alternative options for --help, --version
## or --unknownopt. "x" means "not implemented".
##
@@ -32,6 +35,7 @@ function exec_option {
local cmdb=$1
local cmd=$2
opt=$3
+ local tofile="/tmp/checkusage$opt"
local alt="alt_${cmdb}${opt}"
alt=${alt//-/_}
@@ -44,6 +48,12 @@ function exec_option {
opt=$alt
fi
+ test -z "$CU_DUMP" || {
+ echo "##########################################################"
+ echo "#### $cmdb"
+ $cmd $opt
+ } >> "$tofile" 2>&1
+
out=$("$cmd" $opt 2>/dev/null)
err=$("$cmd" $opt 2>&1 >/dev/null)
ret=$?