From: DeaDDooMER Date: Mon, 22 Jul 2019 15:52:36 +0000 (+0300) Subject: add option -version X-Git-Tag: v0.2~5 X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=cd7e2ed80772dd1537f6dc320dfc506311495fc9;p=cpc.git add option -version --- diff --git a/src/generic/Dsw/Mod/Compiler486Main.cp b/src/generic/Dsw/Mod/Compiler486Main.cp index 5d1a68f..0718582 100644 --- a/src/generic/Dsw/Mod/Compiler486Main.cp +++ b/src/generic/Dsw/Mod/Compiler486Main.cp @@ -11,6 +11,8 @@ MODULE DswCompiler486Main; hint = 29; oberon = 30; errorTrap = 31; defopt = {checks, assert, obj, ref, allref, srcpos, signatures}; + version = "0.2"; + emulong = 0; defopt2 = {}; @@ -166,6 +168,9 @@ MODULE DswCompiler486Main; INCL(opts2, emulong) ELSIF p = "-no-long-calls" THEN EXCL(opts2, emulong) + ELSIF p = "-version" THEN + Console.WriteStr(version); Console.WriteLn; + Kernel.Quit(0) ELSE Console.WriteStr("unknown option "); Console.WriteStr(p); Console.WriteLn; diff --git a/src/generic/Dsw/Mod/CompilerCPfrontMain.cp b/src/generic/Dsw/Mod/CompilerCPfrontMain.cp index b5d4ec9..efbd6f7 100644 --- a/src/generic/Dsw/Mod/CompilerCPfrontMain.cp +++ b/src/generic/Dsw/Mod/CompilerCPfrontMain.cp @@ -12,6 +12,8 @@ MODULE DswCompilerCPfrontMain; (* defopt = {checks, assert, obj, ref, allref, srcpos, signatures}; *) defopt = {checks, assert, obj}; + version = "0.2"; + emulong = 0; defopt2 = {}; @@ -167,6 +169,9 @@ MODULE DswCompilerCPfrontMain; INCL(opts2, emulong) ELSIF p = "-no-long-calls" THEN EXCL(opts2, emulong) + ELSIF p = "-version" THEN + Console.WriteStr(version); Console.WriteLn; + Kernel.Quit(0) ELSE Console.WriteStr("unknown option "); Console.WriteStr(p); Console.WriteLn; diff --git a/src/generic/Dsw/Mod/Linker486Main.cp b/src/generic/Dsw/Mod/Linker486Main.cp index 677681f..9396d01 100644 --- a/src/generic/Dsw/Mod/Linker486Main.cp +++ b/src/generic/Dsw/Mod/Linker486Main.cp @@ -7,6 +7,8 @@ MODULE DswLinker486Main; CONST tgtElfStatic = 0; tgtElfExe = 1; tgtElfDll = 2; tgtPeExe = 3; tgtPeDll = 4; + version = "0.2"; + TYPE Elem = POINTER TO RECORD name: ARRAY 256 OF CHAR; @@ -105,6 +107,9 @@ MODULE DswLinker486Main; ELSIF p = "-trap" THEN LB.trap := TRUE; Kernel.intTrap := TRUE + ELSIF p = "-version" THEN + Console.WriteStr(version); Console.WriteLn; + Kernel.Quit(0) ELSE Console.WriteStr("unknown option "); Console.WriteStr(p); Console.WriteLn;