Command line parsing
Vladimir Panteleev via Digitalmars-d
digitalmars-d at puremagic.com
Tue May 17 18:15:44 PDT 2016
On Monday, 16 May 2016 at 06:36:03 UTC, Jacob Carlborg wrote:
> On 2016-05-16 01:36, Vladimir Panteleev wrote:
>
>> I'm not sure if you saw it, but funopt uses the same basic
>> idea.
>>
>> When writing ae.utils.funopt, I debated for a bit whether I
>> should use a
>> struct or a function signature as the base for specifying the
>> arguments
>> and their documentation. In the end I went with a function,
>> because it
>> covered all the most important cases, was simpler to use, and
>> closer
>> follows the analogy of invoking a process with some arguments
>> vs.
>> calling a function with some arguments.
>
> To me it looks like it can get a bit too verbose for a single
> function when having more than a couple of flags.
I'm not sure what you mean, but if you mean what I think you
mean, then just write the parameter list with one parameter per
line, and it's no different from a struct.
More information about the Digitalmars-d
mailing list