diff --git a/compiler/commands.nim b/compiler/commands.nim index 5b8f569ac3be..d49eee57f691 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -59,6 +59,7 @@ const const Usage = slurp"../doc/basicopt.txt".replace("//", "") AdvancedUsage = slurp"../doc/advopt.txt".replace("//", "") + DeprecatedUsage = slurp"../doc/deprecatedopt.txt".replace("//", "") proc getCommandLineDesc(): string = result = (HelpMessage % [VersionAsString, platform.OS[platform.hostOS].name, @@ -69,14 +70,19 @@ proc helpOnError(pass: TCmdLinePass) = msgWriteln(getCommandLineDesc(), {msgStdout}) msgQuit(0) -proc writeAdvancedUsage(pass: TCmdLinePass) = +proc writeHelpFull(pass: TCmdLinePass) = if pass == passCmd1: msgWriteln(`%`(HelpMessage, [VersionAsString, platform.OS[platform.hostOS].name, - CPU[platform.hostCPU].name]) & AdvancedUsage, + CPU[platform.hostCPU].name]) & Usage & AdvancedUsage, {msgStdout}) msgQuit(0) +proc writeDeprecatedCommands(pass: TCmdLinePass) = + if pass == passCmd1: + msgWriteln(DeprecatedUsage, {msgStdout}) + msgQuit(0) + proc writeVersionInfo(pass: TCmdLinePass) = if pass == passCmd1: msgWriteln(`%`(HelpMessage, [VersionAsString, @@ -608,9 +614,12 @@ proc processSwitch(switch, arg: string, pass: TCmdLinePass, info: TLineInfo; of "version", "v": expectNoArg(switch, arg, pass, info) writeVersionInfo(pass) - of "advanced": + of "helpfull", "advanced": + expectNoArg(switch, arg, pass, info) + writeHelpFull(pass) + of "deprecatedcommands": expectNoArg(switch, arg, pass, info) - writeAdvancedUsage(pass) + writeDeprecatedCommands(pass) of "help", "h": expectNoArg(switch, arg, pass, info) helpOnError(pass) diff --git a/compiler/msgs.nim b/compiler/msgs.nim index 70504cfc94a6..bbd67845bce1 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -876,7 +876,7 @@ proc quit(msg: TMsgKind) = writeStackTrace() else: styledMsgWriteln(fgRed, "No stack traceback available\n" & - "To create a stacktrace, rerun compilation with ./koch temp " & + "To create a stacktrace, rerun compilation without `-d:release`, eg: ./koch temp " & options.command & " ") quit 1 diff --git a/doc/advopt.txt b/doc/advopt.txt index 7d8d81c4f905..b59439bc98f0 100644 --- a/doc/advopt.txt +++ b/doc/advopt.txt @@ -87,4 +87,5 @@ Advanced options: value = number of processors (0 for auto-detect) --verbosity:0|1|2|3 set Nim's verbosity level (1 is default) --experimental enable experimental language features + --deprecatedCommands show deprecated command line switches (incomplete) -v, --version show detailed version information diff --git a/doc/basicopt.txt b/doc/basicopt.txt index 4db2d5af74d7..96e594633f21 100644 --- a/doc/basicopt.txt +++ b/doc/basicopt.txt @@ -36,7 +36,7 @@ Options: --app:console|gui|lib|staticlib generate a console app|GUI app|DLL|static library -r, --run run the compiled program with given arguments - --advanced show advanced command line switches + --helpFull show full command line switches -h, --help show this help Note, single letter options that take an argument require a colon. E.g. -p:PATH. diff --git a/doc/deprecatedopt.txt b/doc/deprecatedopt.txt new file mode 100644 index 000000000000..b604897d691f --- /dev/null +++ b/doc/deprecatedopt.txt @@ -0,0 +1,4 @@ + deprecated command line switches + +advanced => helpFull +babelpath => nimblePath