[mlpack-svn] r11372 - mlpack/trunk/CMake
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Fri Feb 3 18:03:24 EST 2012
Author: rcurtin
Date: 2012-02-03 18:03:23 -0500 (Fri, 03 Feb 2012)
New Revision: 11372
Modified:
mlpack/trunk/CMake/exec2man.sh
Log:
Wow, awk is crazy. This fixes warnings in the troff output given by txt2man.
Modified: mlpack/trunk/CMake/exec2man.sh
===================================================================
--- mlpack/trunk/CMake/exec2man.sh 2012-02-03 22:54:30 UTC (rev 11371)
+++ mlpack/trunk/CMake/exec2man.sh 2012-02-03 23:03:23 UTC (rev 11372)
@@ -60,9 +60,14 @@
# txt2man -T -P mlpack -t $name -d 1
# Now do it.
+# The awk script is a little ugly, but it is meant to format parameters
+# correctly so that the entire description of the parameter is on one line (this
+# helps avoid 'man' warnings).
./$name -h | \
awk -v syn="$synopsis" \
'{ if (NR == 1) print "NAME\n '$name' - "tolower($0)"\nSYNOPSIS\n "syn" \nDESCRIPTION\n" ; else print } ' | \
sed '/^[^ ]/ y/qwertyuiopasdfghjklzxcvbnm:/QWERTYUIOPASDFGHJKLZXCVBNM /' | \
+ sed 's/ / /g' | \
+ awk '/NAME/,/REQUIRED OPTIONS/ { print; } /REQUIRED OPTIONS/,0 { if (!/REQUIRED_OPTIONS/ && !/OPTIONS/) { if (/ --/) { printf "\n" } sub(/^[ ]*/, ""); sub(/ [ ]*/, " "); printf "%s ", $0; } else { if (!/REQUIRED OPTIONS/) { print "\n"$0; } } }' | \
txt2man -P mlpack -t $name -d 1 > $output
More information about the mlpack-svn
mailing list