It would be nice to have though... I have take the liberty to open [Issue
#6201](https://github.com/nim-lang/Nim/issues/6201) on GitHub.
With a sufficiently ugly hack, all things are possible...
import strutils
static:
proc getNimCompilerCmdLine(): string =
return staticRead("/proc/self/cmdline").replace('\0', ' ')
const nimCompilerCmdLine = getNimCompilerCmdLine()
Interestingly, you cannot do that for now. All you can do is to do something
like
when not defined(cpp):
{.error: "compile via the 'cpp' command".}
for example:
code
{.backend:cpp.}
config
compileTo:cpp