Commit b5c969ca authored by rdubner's avatar rdubner

First appearance of 3.9. exit $result at end of cobcd. Fix cobst -v to just return version code.

parent 9c3eb08b
...@@ -40,8 +40,7 @@ print_help() ...@@ -40,8 +40,7 @@ print_help()
echo "This is the cobc debugging wrapper $1 $2" echo "This is the cobc debugging wrapper $1 $2"
echo "Use it as you would 'cobc'" echo "Use it as you would 'cobc'"
echo "" echo ""
echo "It doesn't take any switches except --help, although it looks at" echo "It doesn't take any switches except --help and --version"
echo "--version as it goes by go by on its way to cobc."
echo "" echo ""
echo "If there is a -T or -t switch, the unmodified cobc compile will take place to generate" echo "If there is a -T or -t switch, the unmodified cobc compile will take place to generate"
echo "the listing file before the more complex debug build is done." echo "the listing file before the more complex debug build is done."
...@@ -64,7 +63,7 @@ print_help() ...@@ -64,7 +63,7 @@ print_help()
## Don't mess with it! # ## Don't mess with it! #
########################################################################### ###########################################################################
SCRIPT_VERSION="[Version 3.8]" SCRIPT_VERSION="[Version 3.9]"
# This script, nominally named cobcd, packages up the process of compiling # 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 # a single COBOL source module and processing it so that gdb can be used for
...@@ -238,6 +237,10 @@ if [ $ASKED_FOR_HELP ] ...@@ -238,6 +237,10 @@ if [ $ASKED_FOR_HELP ]
if [ $ASKED_FOR_VERSION ] if [ $ASKED_FOR_VERSION ]
then then
usage $SCRIPT_VERSION usage $SCRIPT_VERSION
$COBST -v
$SFIX -v
$COBC --version
exit 0
fi fi
result="0" result="0"
...@@ -378,15 +381,20 @@ case "$os_name" in ...@@ -378,15 +381,20 @@ case "$os_name" in
DASH_F="" DASH_F=""
DASH_S="" DASH_S=""
esac esac
if [ "ECHO" ]
then
DASH_Q=-q
fi
## We can now create the .sym.c file: ## We can now create the .sym.c file:
if [ "$result" = "0" ] if [ "$result" = "0" ]
then then
if [ "$ECHO" ] if [ "$ECHO" ]
then then
echo $COBST -q $DASH_F $DASH_S $FILE_ROOT $FILE_CBL echo $COBST $DASH_Q $DASH_F $DASH_S $FILE_ROOT $FILE_CBL
fi fi
$COBST -q $DASH_F $DASH_S $FILE_ROOT $FILE_CBL $COBST $DASH_Q $DASH_F $DASH_S $FILE_ROOT $FILE_CBL
result=$? result=$?
fi fi
...@@ -406,9 +414,9 @@ if [ "$result" = "0" ]; then ...@@ -406,9 +414,9 @@ if [ "$result" = "0" ]; then
# Modify the .s file, removing all .loc references to # Modify the .s file, removing all .loc references to
# FILE_ROOT.c and any .h files. The modification is done "in-place". # FILE_ROOT.c and any .h files. The modification is done "in-place".
if [ "$ECHO" ]; then if [ "$ECHO" ]; then
echo $SFIX -q $FILE_S $FILE_S $FILE_C $FILE_CBL echo $SFIX $DASH_Q $FILE_S $FILE_S $FILE_C $FILE_CBL
fi fi
$SFIX -q $FILE_S $FILE_S $FILE_C $FILE_CBL $SFIX $DASH_Q $FILE_S $FILE_S $FILE_C $FILE_CBL
result=$? result=$?
fi fi
...@@ -493,3 +501,5 @@ if [ -z "$COBCDNOCLEAN" ]; ...@@ -493,3 +501,5 @@ if [ -z "$COBCDNOCLEAN" ];
rm -fr $FILE_O rm -fr $FILE_O
rm -fr $FILE_ROOT.sym.[co] rm -fr $FILE_ROOT.sym.[co]
fi fi
exit $result
...@@ -237,11 +237,6 @@ OpenOrFail(std::ofstream &ofs,const std::string &fname,std::ios_base::openmode m ...@@ -237,11 +237,6 @@ OpenOrFail(std::ofstream &ofs,const std::string &fname,std::ios_base::openmode m
void void
PARAMETERS::GetParameters(int argc, char *argv[]) PARAMETERS::GetParameters(int argc, char *argv[])
{ {
if(argc < 3) {
Usage();
exit(1);
}
quiet = false; quiet = false;
insert_python = false; insert_python = false;
insert_filename = false; insert_filename = false;
...@@ -273,6 +268,12 @@ PARAMETERS::GetParameters(int argc, char *argv[]) ...@@ -273,6 +268,12 @@ PARAMETERS::GetParameters(int argc, char *argv[])
break; break;
} }
} }
if(argc < 3) {
Usage();
exit(1);
}
if( optind >= argc ) { if( optind >= argc ) {
Usage(); Usage();
exit(1); exit(1);
......
...@@ -7,7 +7,7 @@ SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION ...@@ -7,7 +7,7 @@ SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
::## Don't mess with it! # ::## Don't mess with it! #
::########################################################################### ::###########################################################################
:: ::
set VERSION=[Version 3.8] set VERSION=[Version 3.9]
:: ::
:: ::
set argC=0 set argC=0
......
...@@ -4,4 +4,4 @@ ...@@ -4,4 +4,4 @@
// On the Unix side, there is scripting trickery to propogate this version // 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. // code into cobcd.py and the names of packages when they are created.
#define VERSION "3.8" #define VERSION "3.9"
...@@ -3163,7 +3163,7 @@ if 'gdb' in sys.modules : ...@@ -3163,7 +3163,7 @@ if 'gdb' in sys.modules :
## The text "Version x.x" has to appear in square brackets. # ## The text "Version x.x" has to appear in square brackets. #
## Don't mess with it! # ## Don't mess with it! #
########################################################################### ###########################################################################
print('registering CPrint (Usage is "print <COBOL identifier>") [Version 3.8]') print('registering CPrint (Usage is "print <COBOL identifier>") [Version 3.9]')
self.Worker = CPrintWorker() self.Worker = CPrintWorker()
self.TabFile = TabFileInformation(); self.TabFile = TabFileInformation();
......
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