[started separate thread]
On Thu, 11 Nov 2010 00:58:31 +0100
Tomek Sowiński wrote:
> Andrei Alexandrescu napisał:
>
> >> Speaking of getopt, when writing the 'grep' snippet I missed anonymous
> >> options a lot:
> >>
> >> bool h, i; string expr; string[] files;
> >> getopt(args, "h",&h, "i",&i,
spir Wrote:
> [started separate thread]
>
> On Thu, 11 Nov 2010 00:58:31 +0100
> Tomek SowiÅski wrote:
>
> > Andrei Alexandrescu napisaÅ:
> >
> > >> Speaking of getopt, when writing the 'grep' snippet I missed anonymous
> > >> options a lot:
> > >>
> > >> bool h, i; string expr; string[] fil
ruben niemann Wrote:
> spir Wrote:
>
> > [started separate thread]
> >
> > On Thu, 11 Nov 2010 00:58:31 +0100
> > Tomek SowiÅski wrote:
> >
> > > Andrei Alexandrescu napisaÅ:
> > >
> > > >> Speaking of getopt, when writing the 'grep' snippet I missed anonymous
> > > >> options a lot:
> > >
spir wrote:
> I thought once at a default interface between the command-line and a
> program's startup routine, main().
We could actually do this with a mixin.
==
int findword (string filename, string word, bool verbose=false) {...}
mixin MakeMain!(findword);
==
And that MakeMain temp
On Thu, 11 Nov 2010 13:45:33 +, Adam Ruppe wrote:
> I actually wrote something that does this already, though my goal was to
> automate the creation of web apps, it also (used to - I broke it in my
> last revision) works for command line programs.
>
> http://arsdnet.net/dcode/web.d
>
> [...]
Lars T. Kyllingstad wrote:
> Have you ever considered cleaning it up and publishing it as
> a web app library for D, either on dsource or somewhere similar?
Yes, I'd like to do that eventually, but haven't gotten around to it yet. You
can
see, looking through the code, that I've been lax on docum
spir napisał:
>> // Let's match assignments.
>> auto args = ["program.exe", ".*=.*;", "file1.d", "file2.d", "file3.d"];
>> bool h, i; string expr; string[] files;
>> getopt(args, "h",&h, "i",&i, &expr, &files);
>> assert(!h);
>> assert(!i);
>> assert(expr == ".*=.*;");
>> assert(files == ["file1.d