Commit 2d22a995 authored by rdubner's avatar rdubner

RC 3.14. cobcd script logic to handle combined -abc parameters

parent 449303c2
......@@ -63,7 +63,7 @@ print_help()
## Don't mess with it! #
###########################################################################
SCRIPT_VERSION="[Version 3.13]"
SCRIPT_VERSION="[Version 3.14]"
# This script, nominally named cobcd, packages up the process of compiling
# a single COBOL source module and processing it so that gdb can be used for
......@@ -197,31 +197,106 @@ DASH_V=""
T_FLAG=""
SOURCEFILE=""
while [ "$#" != "0" ]
# This disturbing amount of code addresses the issue of combined
# single-character flags, e.g., "-xgd". It is complex because cobc
# accepts a number of switches that start with a single hyphen, but
# nonetheless have more than one letter, e.g., "-ext". So, although
# we want "-xgd" to turn into "-x -g -d", we need to leave "-ext" alone:
params=""
for p in $@
do
if [ X"$1" = X"--help" ]
if echo $p | grep -qs "^[^-]"
then
## It doesn't start with a single hyphen
params="$params $p"
continue
fi
if echo $p | grep -qs "^[-][-]"
then
## It starts with a double hyphen
params="$params $p"
continue
fi
if echo $p | grep -qs "^[-]f"
then
params="$params $p"
continue
fi
if echo $p | grep -qs "^[-]W"
then
params="$params $p"
continue
fi
if echo $p | grep -qs "^[-]O"
then
params="$params $p"
continue
fi
if echo $p | grep -qs "^[-]list"
then
params="$params $p"
continue
fi
## When you get here, you have a token with a single hyphen:
if [ ${#p} -le 2 ]
then
## It is only one or two characters long
params="$params $p"
continue
fi
# We have a hyphen and some letters
# extract those letters:
token=$(echo $p | sed -E "s/[-]([^=]+).*/\\1/g")
case "$token" in
"help"|"version"|"info"|"brief"|"###"|"verbose"|"vv"|"vvv"| \
"job"|"std"|"free"|"fixed"|"debug"|"Xref"|"conf"|"save-temps"|"ext" \
)
params="$params $p"
continue
esac
## Arriving here means that you have, or you are supposed to have,
## some combined single-character switches
letters=$(echo $p | sed -E "s/(.)/\\1 /g")
for letter in $letters
do
if [ X"$letter" = X"-" ]
then
continue
fi
params="$params -$letter"
done
done
for param in $params
do
if [ X"$param" = X"--help" ]
then
ASKED_FOR_HELP=yes
fi
if [ X"$1" = X"--version" ]
if [ X"$param" = X"--version" ]
then
ASKED_FOR_VERSION=yes
fi
if [ X"$1" = X"-v" ]
if [ X"$param" = X"-v" ]
then
DASH_V=-v
fi
if echo $1 | grep -iqs -e "-t"
if echo $param | grep -iqs -e "-t"
then
T_FLAG=yes
fi
case $1 in
case $param in
-x|-m|-b)
COBCDXM=$1
COBCDXM=$param
;;
esac
COMMAND_LINE="$COMMAND_LINE $1"
shift
COMMAND_LINE="$COMMAND_LINE $param"
done
if [ "$COBCDXM" = "" ]
......@@ -381,7 +456,7 @@ case "$os_name" in
DASH_F=""
DASH_S=""
esac
if [ "ECHO" ]
then
DASH_Q=-q
......
......@@ -7,7 +7,7 @@ SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
::## Don't mess with it! #
::###########################################################################
::
set VERSION=[Version 3.13]
set VERSION=[Version 3.14]
::
::
set argC=0
......
......@@ -4,4 +4,4 @@
// On the Unix side, there is scripting trickery to propogate this version
// code into cobcd.py and the names of packages when they are created.
#define VERSION "3.13"
#define VERSION "3.14"
......@@ -3319,7 +3319,7 @@ if 'gdb' in sys.modules :
## The text "Version x.x" has to appear in square brackets. #
## Don't mess with it! #
###########################################################################
print('registering CPrint (Usage is "print <COBOL identifier>") [Version 3.13]')
print('registering CPrint (Usage is "print <COBOL identifier>") [Version 3.14]')
self.Worker = CPrintWorker()
self.TabFile = TabFileInformation();
self.TabFile.question_mark_range = self.Worker.question_mark_range
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment