From 98df526526dc3fb95a7eb4f1a601794b9e56b23a Mon Sep 17 00:00:00 2001 From: DeaDDooMER Date: Mon, 24 Feb 2020 16:51:20 +0300 Subject: [PATCH] cpmake: add version printing --- src/generic/Dsw/Mod/MakeMain.cp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/generic/Dsw/Mod/MakeMain.cp b/src/generic/Dsw/Mod/MakeMain.cp index 57a46d9..57822e5 100644 --- a/src/generic/Dsw/Mod/MakeMain.cp +++ b/src/generic/Dsw/Mod/MakeMain.cp @@ -3,6 +3,8 @@ MODULE DswMakeMain; IMPORT Kernel, Files, Log, Strings, DswOpts, DswProcs, DswDocuments, DevCPM, DevCPT, DevCPR, DevCPS; CONST + version = "0.3.0"; + maxImps = 127; maxJobs = maxImps; @@ -262,11 +264,17 @@ MODULE DswMakeMain; Log.String(" -j num Specifies the number of jobs to run simultaneously"); Log.Ln; Log.String(' -D ident["+"|"-"] Add preprocessor selector'); Log.Ln; Log.String(' -U ident Remove preprocessor selector'); Log.Ln; - Log.String(" -h Print help"); Log.Ln; - Log.String(" -v Print version"); Log.Ln; + Log.String(" -h Print help and quit"); Log.Ln; + Log.String(" -V Print version and quit"); Log.Ln; Kernel.Quit(1) END Help; + PROCEDURE Version; + BEGIN + Log.String(version); Log.Ln; + Kernel.Quit(0) + END Version; + PROCEDURE ParseTargetOpts; VAR s: DswOpts.String; BEGIN @@ -332,11 +340,12 @@ MODULE DswMakeMain; exe := NIL; auto := FALSE; jobs := 1; def.next := NIL; mno := 0; rno := 0; processor := anymach; os := anyos; compiler := anycp; LOOP - CASE DswOpts.GetOpt("ao:j:D:U:TCXh") OF + CASE DswOpts.GetOpt("ao:j:D:U:TCXhV") OF | "a": auto := TRUE | "o": exe := DswOpts.str | "j": jobs := MIN(MAX(StrToInt(DswOpts.str, 1), 1), maxJobs) | "h": Help + | "V": Version | "D": Define(DswOpts.str) | "U": Undefine(DswOpts.str) | "T": ParseTargetOpts @@ -347,7 +356,7 @@ MODULE DswMakeMain; | "$": AddModule(DswOpts.str, def) | 0X: EXIT END - END + END; END ParseArgs; PROCEDURE CheckParams; -- 2.29.2