Alien-Judy
view release on metacpan or search on metacpan
src/judy-1.0.5/test/jbgraph view on Meta::CPAN
# - use getopts.
# Note: FUNCTION__getopt is run twice, in order to support:
# FUNCTION_TITLE_COLHEAD() # Set Column headings from file.
${v}echo "${C}.${0}: beginning at `date`" # beginning of function
USAGE="${C} [ -E -G -H -I -M -S -V -i -l -m -q -r -u -v ]
[ -C GNU_CMDFILE ]
[ -D LP_DEV ]
[ -L axis ]
[ -N not option ] (turn off option), Example: -NL
[ -P GNU_PSFILE ]
[ -c COLUMN_NUMBER ]
[ -d differential_type ]
[ -g GNU_GEOMETRY ]
[ -o LP_OPT ]
[ -x xRANGE ]
[ -y yRANGE ]
${C}: wrapper for gnuplot
-c plot column number. This is useful to plot by column number.
-i plot insert; default if no other plots selected. CMN=2
-r plot retrievals; default if no other plots selected. CMN=4
-I plot memory used / index. CMN=12
-m plot memory malloced. CMN=9
-M plot memory used and free. CMN=8
-l plot leaf data. CMN=11
-d plot derivative data. Useful with -i, -r, -m. CMN=2,4,9
-x xRANGE, scale range; example: -x [1000:5000] or -x1000:5000
-y yRANGE, scale range; example: -y [1M:10M] or -y1M:10M
1[kK] = 1,000; 1[mM] = 1,000,000; 1[gG] = 1,000,000,000.
-n number plot descriptions; Use column numbers before the description.
-L set logscale axis; default,
Example: Turn off logscale with -NL, then turn on, on only one axis:
\"-NL -Lx\" or \"-NL -Ly\", Turn off both with -NL
-G grid lines on.
-H default column headings.
-g geometry description.
default=\"${GNU_GEOMETRY_DEF}\", # 4x3 aspect ratio.
-E use embedded options, default, Turn off with -NE.
Sets TITLE, COLHEAD, GETOPT from the FIRST data file encountered.
Example: embedded options in the data file begin in column 1:
# TITLE This is the title to pass to gnuplot
# COLHEAD 1 This is the heading for column 1.
# XLABEL This is the x-axis label
# YLABEL This is the y-axis label
# GETOPT -c2 -c3 -G # These are the options to use.
-p print the plot.
-o LP_OPT printer option(s); default \"${LP_OPT_DEF}\".
Example: \"-ootray2\" will print on clear slides, emits \"-otray2\"
Example: \"-on2\" will print two copies, emits \"-n2\"
-D LP_DEV printer device; default \"${LP_DEV_DEF}\".
-C GNU_CMDFILE name; default is generated and removed:
${OUTPUT_DIR}/{DATE_TIME}.GNU_CMDFILE
Useful to do your own gnuplot command editing and debugging.
-P GNU_PSFILE name. default is generated and removed:
${OUTPUT_DIR}/{DATE_TIME}.GNU_PSFILE
-S Save files.
Generated and working file names are deleted unless -S or -C is on.
User provided file names are not deleted in any case (-C, -P).
-q quiet mode, verbose mode off; default.
-v verbose mode on.
-V vi the plot file.
quit using \"q\"
-N not option; Turn specified option off. Example: -NL
Note, -N is not available for all options.
-NL Turn off: -L set logscale axis; default
-NH Turn off: -H default column headings.
-u Usage message.
Sample usage:
${C} -i -f data/datafile # -i is the same as -c1.
${C} -c1 -f data/datafile # -i is the same as -c1.
"
${v}echo "${C}.${0}: OPTIONS=${*}"
# Parse options, using getopt:
#
# - "a" option, no parameter; "b:" indicates a parameter.
# - Order of options is "man 5 ascii".
getopt_PARM="?C:D:EGIL:MN:P:SVc:d:g:ilmno:prsuvx:y:"
set -- `getopt ${getopt_PARM} $*` # Place options in argc/argv.
if [ "${?}" != "0" ]; then # If getopt returns an errror.
${v}echo "${C}.${0}: \${?}=${?}, USAGE message from return code."
echo "${USAGE}"
exit 1
fi
while [ ${#} -gt 0 ] # while there are options...
do # ( for vi parenthesis matching
${v}echo "${C}.${0}: parsing option \"${1}\", then \"${2}\""
case ${1} in
-C)
OPT_C="${1}"
OPT_C_PARM="${2}" # GNU_CMDFILE name.
${v}echo "${C}.${0}: OPT_C=${OPT_C}, # -C GNU_CMDFILE name."
${v}echo "${C}.${0}: OPT_C_PARM=${OPT_C_PARM}, # GNU_CMDFILE name."
export GNU_CMDFILE="${OPT_C_PARM}"
MSG="# GNU_CMDFILE name."
${v}echo "${C}.${0}: GNU_CMDFILE=${GNU_CMDFILE}, ${MSG}"
shift
;; # ( for vi parenthesis matching
-D)
OPT_D="${1}"
OPT_D_PARM="${2}" # LP_DEV name.
${v}echo "${C}.${0}: OPT_D=${OPT_D}, # -D LP_DEV printer device."
( run in 0.689 second using v1.01-cache-2.11-cpan-13bb782fe5a )