comparison trunk/src/main.d @ 780:edd217e14736

Using CompilationContext in command 'igraph'.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Wed, 20 Feb 2008 23:13:56 +0100
parents 8e6fed11bb68
children 05dfe88dd3bb
comparison
equal deleted inserted replaced
779:8e6fed11bb68 780:edd217e14736
152 cmd.Generate.execute(fileName, options, infoMan); 152 cmd.Generate.execute(fileName, options, infoMan);
153 infoMan.hasInfo && printErrors(infoMan); 153 infoMan.hasInfo && printErrors(infoMan);
154 break; 154 break;
155 case "importgraph", "igraph": 155 case "importgraph", "igraph":
156 string filePath; 156 string filePath;
157 string[] includePaths;
158 string[] regexps; 157 string[] regexps;
159 string siStyle = "dashed"; // static import style 158 string siStyle = "dashed"; // static import style
160 string piStyle = "bold"; // public import style 159 string piStyle = "bold"; // public import style
161 uint levels; 160 uint levels;
162 IGraphOption options; 161 IGraphOption options;
162 auto context = newCompilationContext();
163 foreach (arg; args[2..$]) 163 foreach (arg; args[2..$])
164 { 164 {
165 if (strbeg(arg, "-I")) 165 if (parseDebugOrVersion(arg, context))
166 includePaths ~= arg[2..$]; 166 {}
167 else if (strbeg(arg, "-I"))
168 context.importPaths ~= arg[2..$];
167 else if(strbeg(arg, "-r")) 169 else if(strbeg(arg, "-r"))
168 regexps ~= arg[2..$]; 170 regexps ~= arg[2..$];
169 else if(strbeg(arg, "-l")) 171 else if(strbeg(arg, "-l"))
170 levels = Integer.toInt(arg[2..$]); 172 levels = Integer.toInt(arg[2..$]);
171 else if(strbeg(arg, "-si")) 173 else if(strbeg(arg, "-si"))
195 options |= IGraphOption.MarkCyclicModules; break; 197 options |= IGraphOption.MarkCyclicModules; break;
196 default: 198 default:
197 filePath = arg; 199 filePath = arg;
198 } 200 }
199 } 201 }
200 cmd.ImportGraph.execute(filePath, includePaths, regexps, levels, siStyle, piStyle, options); 202 cmd.ImportGraph.execute(filePath, context, regexps, levels, siStyle, piStyle, options);
201 break; 203 break;
202 case "stats", "statistics": 204 case "stats", "statistics":
203 char[][] filePaths; 205 char[][] filePaths;
204 bool printTokensTable; 206 bool printTokensTable;
205 bool printNodesTable; 207 bool printNodesTable;