Thread overview | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
May 09, 2014 Recommendation on option parsing | ||||
---|---|---|---|---|
| ||||
Phobos' std.getopt is a bit spare for my taste, as there is no builtin general help facility with word-wrapping. Does anyone have a recommendation on which of the existing command line option parsing libraries floating around in the wild to use? If it doesn't compile against the current version of phobos I'm willing to put in a little work, but since I'm very new to D I probably would not make the best design decisions. -- Chris |
May 10, 2014 Re: Recommendation on option parsing | ||||
---|---|---|---|---|
| ||||
Posted in reply to Chris Piker | On 2014-05-10 01:09, Chris Piker wrote: > Phobos' std.getopt is a bit spare for my taste, as there is > no builtin general help facility with word-wrapping. > > Does anyone have a recommendation on which of the existing > command line option parsing libraries floating around in the > wild to use? If it doesn't compile against the current > version of phobos I'm willing to put in a little work, but > since I'm very new to D I probably would not make the best > design decisions. I'm using the one in Tango [1] with some additions [2]. It's a bit messy and I don't consider it stable, but it will automatically generate the help text. You can see some of it's uses here [3]. [1] https://github.com/SiegeLord/Tango-D2 [2] https://github.com/jacob-carlborg/mambo/tree/master/mambo/arguments [3] https://github.com/jacob-carlborg/dstep/blob/master/dstep/driver/Application.d#L53 -- /Jacob Carlborg |
May 10, 2014 Re: Recommendation on option parsing | ||||
---|---|---|---|---|
| ||||
Posted in reply to Chris Piker | On 05/10/2014 01:09 AM, Chris Piker via Digitalmars-d-learn wrote: > Phobos' std.getopt is a bit spare for my taste, as there is no builtin general help facility with word-wrapping. > > Does anyone have a recommendation on which of the existing command line option parsing libraries floating around in the wild to use? If it doesn't compile against the current version of phobos I'm willing to put in a little work, but since I'm very new to D I probably would not make the best design decisions. > > -- > Chris please help to make this happen https://github.com/D-Programming-Language/phobos/pull/2072 |
May 12, 2014 Re: Recommendation on option parsing | ||||
---|---|---|---|---|
| ||||
Posted in reply to Robert Schadek | On Saturday, 10 May 2014 at 11:59:03 UTC, Robert Schadek via
Digitalmars-d-learn wrote:
> On 05/10/2014 01:09 AM, Chris Piker via Digitalmars-d-learn wrote:
>> Phobos' std.getopt is a bit spare for my taste, as there is
>> no builtin general help facility with word-wrapping.
>> ...
>> --
>> Chris
> please help to make this happen
> https://github.com/D-Programming-Language/phobos/pull/2072
I'm not sure what you are asking for. Would you like me to tryout
getoptEx? If so, then sure I can do that, why not. (Assuming I
can
figure out how to download your source file from github.)
If you are asking me to affect phobos, well, that's a little out
of my league for now.
--
Chris
|
May 12, 2014 Re: Recommendation on option parsing | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On Saturday, 10 May 2014 at 09:50:04 UTC, Jacob Carlborg wrote:
> On 2014-05-10 01:09, Chris Piker wrote:
>> Phobos' std.getopt is a bit spare for my taste, as there is
>> no builtin general help facility with word-wrapping.
>> ...
>
> I'm using the one in Tango [1] with some additions [2]. It's a bit messy and I don't consider it stable, but it will automatically generate the help text. You can see some of it's uses here [3].
>
> [1] https://github.com/SiegeLord/Tango-D2
> [2] https://github.com/jacob-carlborg/mambo/tree/master/mambo/arguments
> [3] https://github.com/jacob-carlborg/dstep/blob/master/dstep/driver/Application.d#L53
Thanks for the reference. Just perusing your class structure
it looks like a well thought out module. Unfortunatly this
also seems a heavy dependency to pull in, I have to use Tango
and then mombo on top of that. Over the long haul that might
be the best answer, but I'm working on a rather small set of
programs for right now.
--
Chris
|
May 12, 2014 Re: Recommendation on option parsing | ||||
---|---|---|---|---|
| ||||
Posted in reply to Chris Piker | On 05/12/2014 10:44 PM, Chris Piker via Digitalmars-d-learn wrote:
> On Saturday, 10 May 2014 at 11:59:03 UTC, Robert Schadek via Digitalmars-d-learn wrote:
>> On 05/10/2014 01:09 AM, Chris Piker via Digitalmars-d-learn wrote:
>>> Phobos' std.getopt is a bit spare for my taste, as there is
>>> no builtin general help facility with word-wrapping.
>>> ...
>>> --
>>> Chris
>> please help to make this happen https://github.com/D-Programming-Language/phobos/pull/2072
>
> I'm not sure what you are asking for. Would you like me to tryout
> getoptEx? If so, then sure I can do that, why not. (Assuming I
> can
> figure out how to download your source file from github.)
yes please test it
|
May 13, 2014 Re: Recommendation on option parsing | ||||
---|---|---|---|---|
| ||||
Posted in reply to Robert Schadek | On Monday, 12 May 2014 at 23:11:57 UTC, Robert Schadek via
Digitalmars-d-learn wrote:
>>>> Chris
>>> please help to make this happen
>>> https://github.com/D-Programming-Language/phobos/pull/2072
>>
>> I'm not sure what you are asking for. Would you like me to tryout getoptEx?
> yes please test it
Okay, I replaced the std.getopt that came with dmd with your
version. My code compiles, but of course it doesn't link
against the old libphobos.so. I'm a complete newbe to D and
am not ready to build a new version of libphobos.so, that's
for the library maintainers to do, which is not a job I'm ready
to sign up for yet. Right now I'm just trying to get my own
project done, and so far D's standard library is being a HUGE
impediment. It's like programming against bare glibc all over
again when I hoped it would be a little more like the Python
standard libary.
Just being a random developer my opinon isn't that important
but, for what it's worth, I think an expanded option handling
feature should be implemented in a separate module. That way
users can try it out without affecting their existing libphobos.
I like your enthusiasm. If you have any modules that don't
require me to rebuild libphobos, I'll be happy to give them a
whirl. Thank's for responding to my inquiry.
--
Chris
|
May 13, 2014 Re: Recommendation on option parsing | ||||
---|---|---|---|---|
| ||||
Posted in reply to Chris Piker | On 05/13/2014 05:40 AM, Chris Piker via Digitalmars-d-learn wrote:
> On Monday, 12 May 2014 at 23:11:57 UTC, Robert Schadek via Digitalmars-d-learn wrote:
>
> Okay, I replaced the std.getopt that came with dmd with your version. My code compiles, but of course it doesn't link against the old libphobos.so. I'm a complete newbe to D and am not ready to build a new version of libphobos.so, that's for the library maintainers to do, which is not a job I'm ready to sign up for yet. Right now I'm just trying to get my own project done, and so far D's standard library is being a HUGE impediment. It's like programming against bare glibc all over again when I hoped it would be a little more like the Python standard libary.
>
> Just being a random developer my opinon isn't that important but, for what it's worth, I think an expanded option handling feature should be implemented in a separate module. That way users can try it out without affecting their existing libphobos.
>
> I like your enthusiasm. If you have any modules that don't require me to rebuild libphobos, I'll be happy to give them a whirl. Thank's for responding to my inquiry.
>
> --
> Chris
Well, it is a pull request for std.getopt, therefore it can't stand alone. That been said, get into getopt.d and copy anything below line 1061 ( the begin of the comment for GetoptExRslt) into a new file. Add all imports from getopt.d + std.getopt and then add the new file to you're build. This allows you to use getoptEx without modifying your systems default libphobos.
|
May 13, 2014 Re: Recommendation on option parsing | ||||
---|---|---|---|---|
| ||||
Posted in reply to Chris Piker | On Tuesday, 13 May 2014 at 03:40:57 UTC, Chris Piker wrote: > I like your enthusiasm. If you have any modules that don't > require me to rebuild libphobos, I'll be happy to give them a > whirl. Thank's for responding to my inquiry. Try Digger! https://github.com/CyberShadow/Digger Run: digger build "master + phobos#2072" Or run the web interface (digger-web), and select the pull from the list. |
May 13, 2014 Re: Recommendation on option parsing | ||||
---|---|---|---|---|
| ||||
Posted in reply to Robert Schadek | >> Okay, I replaced the std.getopt that came with dmd with your
>> version. My code compiles, but of course it doesn't link
>> against the old libphobos.so.
> Well, it is a pull request for std.getopt, therefore it can't stand
> alone. That been said, get into getopt.d and copy anything below line
> 1061 ( the begin of the comment for GetoptExRslt) into a new file. Add
> all imports from getopt.d + std.getopt and then add the new file to
> you're build. This allows you to use getoptEx without modifying your
> systems default libphobos.
I tried that, but you're using private members of std.getopt
(which of course is okay for the way you intended the code
to be used) so I stopped pursuing this solution. In fact, I
used up all the schedule margin that I have for this small work
project just trying to get decent command line handling.
Since there is no more time to spare I've gone back to using
python for my current tasks.
I'll try to use D again sometime in the future. Hopefully
someday the D community will coalesce a bit more around
standard solutions for the un-exciting parts of programming.
As a group you seem to do a great job at tackling the hard
stuff. The logger project I saw on dub last night is a great
example of the simple polish that I need D to have in order
to make the switch from python for my day-to-day programming
needs.
Kind Regards
--
Chris
|
Copyright © 1999-2021 by the D Language Foundation