module myproggy;
import std.stdio;
enum foo = 5;
enum bar = "walter";

int main() {
  writeln(bar);
  return foo;
}

... and you call compiler like:
  dmd myproggy.d -Dfoo=42 -Dbar=hello

smart, new D compiler would replace enums (iff they exist in the source code) with the given arguments, so when you run myproggy, you get "walter" as output, and the exit code is 42.

I don't like it. I would prefer a CTFE-able counter part to boost::program_options that generates thouse enums from a config file.

Reply via email to