improved symbolic string demo

This commit is contained in:
Basile Burg 2014-11-01 12:35:03 +01:00
parent 66a5d9f0e2
commit 11d761c946
2 changed files with 29 additions and 13 deletions

View File

@ -6,28 +6,28 @@ Coedit is a simple IDE for the [D2](http://dlang.org) lang. (**Co** mpile & **Ed
Current features Current features
---------------- ----------------
- multi platform (Win/Linux). - multi platform (Win/Linux).
- projects. - full featured project format and advanced project editor.
- multiple project configurations (set of switches and options). - compile and run directly from the UI.
- compile, run directly from the UI.
- instant run (without saving, script-like). - instant run (without saving, script-like).
- synchronized edition in a block. - synchronized edition in a block.
- D syntax highlighter, folding, identifier markup. - D2 syntax highlighter, folding, identifier markup.
- member list of the current module. - module symbol list.
- manager for the static libraries. - static libraries manager.
- search and replace. - search and replace.
- user-defined tools powered by a string interpolation system.
- [D Completion Daemon](https://github.com/Hackerpilot/DCD) integration for completion proposal and source code hints. - [D Completion Daemon](https://github.com/Hackerpilot/DCD) integration for completion proposal and source code hints.
- mini file browser. - mini file browser.
Missing features before the first beta Missing features before the first beta
-------------------------------------- --------------------------------------
- Options editor. (the big missing stuff) - Options editor. (the big missing thing)
Project information Project information
------------------- -------------------
- status: alpha 6. - status: alpha 6.
- license: MIT. - license: MIT.
- programmed in Object Pascal with [Lazarus + FPC](http://www.lazarus.freepascal.org) as IDE/compilo. - programmed in Object Pascal with [Lazarus & FPC](http://www.lazarus.freepascal.org) as IDE & compiler.
- based on *dmd* (*gdc* or *lmd* specific options are not handled). - based on *DMD* (the alternative backends, LDC or GDC, are not supported).
Setup & test Setup & test
------------ ------------

View File

@ -6,20 +6,36 @@ import std.getopt;
/* /*
pass: pass:
--a=<CPF> --b=<CPP> --c=<CPR> --d=<CFF> --e=<CFP> --f=<CI> --g=<CAF> --h=<CAP> --j=<CPN> --k=<CPFS> --a=<CAF> --b=<CAP> --c=<CFF> --d=<CFP> --e=<CI> --f=<CFP> --g=<CPP> --h=<CPR> --i=<CPN> --j=<CPFS>
as parameters in "Run, Compile and Run file..." as parameters in "Run, Compile and Run file..."
<CPFS>: only the first item is displayed but the symbol is expanded as expected. <CPFS>: only the first item is displayed but the symbol is expanded as expected.
*/ */
void main(string args[]) 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; string expanded;
for (char c = 'a'; c != 'z'; c++) foreach (c; 'a'..'z')
{ {
expanded = ""; expanded = "";
getopt(args, std.getopt.config.passThrough, c, &expanded); getopt(args, std.getopt.config.passThrough, c, &expanded);
if (expanded.length != 0) if (expanded.length)
writeln(c, " : ", expanded); writeln(opt2symbol[c], expanded);
} }
} }