- Added exit codes and use these in testl script.
This commit is contained in:
parent
ca01a09377
commit
d14d5ce06b
20
src/main.c
20
src/main.c
@ -16,7 +16,14 @@
|
||||
*
|
||||
* How to install Scyther.
|
||||
*
|
||||
* \section coding Coding convertions
|
||||
* \section exit Exit codes
|
||||
*
|
||||
* 0 Okay No attack found, claims encountered
|
||||
* 1 Error Something went wrong (error)
|
||||
* 2 Okay No attack found (because) no claims encountered
|
||||
* 3 Okay Attack found
|
||||
*
|
||||
* \section coding Coding conventions
|
||||
*
|
||||
* Usually, each source file except main.c has an myfileInit() and myfileDone() function
|
||||
* available. These allow any initialisation and destruction of required structures.
|
||||
@ -368,6 +375,17 @@ main (int argc, char **argv)
|
||||
if (sys->attack != NULL && sys->attack->length != 0)
|
||||
{
|
||||
attackDisplay(sys);
|
||||
/* mark exit code */
|
||||
exitcode = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* check for no claims */
|
||||
if (sys->failed == 0)
|
||||
{
|
||||
/* mark exit code */
|
||||
exitcode = 2;
|
||||
}
|
||||
}
|
||||
|
||||
/* latex closeup */
|
||||
|
27
src/testl
27
src/testl
@ -13,20 +13,21 @@ template=../src/attacktemplate
|
||||
|
||||
if [ -f $file ]
|
||||
then
|
||||
|
||||
../src/scyther --latex $file -o attack.tex
|
||||
latex $template.tex
|
||||
|
||||
mv $template.dvi attack.dvi
|
||||
dvips attack.dvi -o attack.ps
|
||||
|
||||
# also eps output now
|
||||
ps2eps -f attack.ps
|
||||
|
||||
xdvi attack.dvi # for Xdvi
|
||||
# kdvi attack.dvi # for KDE environment
|
||||
# kghostview attack.ps # postscript in KDE
|
||||
|
||||
if [ "$?" -eq "3" ]
|
||||
then
|
||||
latex $template.tex
|
||||
|
||||
mv $template.dvi attack.dvi
|
||||
dvips attack.dvi -o attack.ps
|
||||
|
||||
# also eps output now
|
||||
ps2eps -f attack.ps
|
||||
|
||||
xdvi attack.dvi # for Xdvi
|
||||
# kdvi attack.dvi # for KDE environment
|
||||
# kghostview attack.ps # postscript in KDE
|
||||
fi
|
||||
else
|
||||
|
||||
echo "No file $file found."
|
||||
|
Loading…
Reference in New Issue
Block a user