module expandSymString; import std.stdio; import std.getopt; /* pass: --a= --b= --c= --d= --e= --f= --g= --h= --i= --j= as parameters in "Run, Compile and Run file..." : only the first item is displayed but the symbol is expanded as expected. */ void main(string args[]) { auto opt2symbol = [ // coedit 'a' : "CoeditApplicationFile..: ", 'b' : "CoeditApplicationPath..: ", // file 'c' : "currentFileFilename....: ", 'd' : "CurrentFilePath........: ", 'e' : "CurrentIdentifier......: ", // project 'f' : "CurrentProjectFile.....: ", 'g' : "CurrentProjectPath.....: ", 'h' : "CurrentProjectRoot.....: ", 'i' : "CurrentProjectName.....: ", 'j' : "CurrentProjectFiles....: " ]; string expanded; foreach (c; 'a'..'z') { expanded = ""; getopt(args, std.getopt.config.passThrough, c, &expanded); if (expanded.length) writeln(opt2symbol[c], expanded); } }