digitalmars.D.learn - Recommendation on option parsing
- Chris Piker (10/10) May 09 2014 Phobos' std.getopt is a bit spare for my taste, as there is
- Jacob Carlborg (10/18) May 10 2014 I'm using the one in Tango [1] with some additions [2]. It's a bit messy...
- Chris Piker (9/22) May 12 2014 Thanks for the reference. Just perusing your class structure
- Robert Schadek via Digitalmars-d-learn (3/13) May 10 2014 please help to make this happen
- Chris Piker (10/19) May 12 2014 I'm not sure what you are asking for. Would you like me to tryout
- Robert Schadek via Digitalmars-d-learn (2/16) May 12 2014 yes please test it
- Chris Piker (21/28) May 12 2014 Okay, I replaced the std.getopt that came with dmd with your
- Robert Schadek via Digitalmars-d-learn (7/28) May 13 2014 Well, it is a pull request for std.getopt, therefore it can't stand
- Chris Piker (18/32) May 13 2014 I tried that, but you're using private members of std.getopt
- Jesse Phillips (6/9) May 13 2014 Not sure why he had you break up the file. It should be as simple
- Chris Piker (12/13) May 13 2014 True, but they wouldn't need to have much more to pass the
- Robert Schadek via Digitalmars-d-learn (2/11) May 14 2014
- Vladimir Panteleev (6/9) May 13 2014 Try Digger!
- Chris Piker (7/16) May 13 2014 Thanks for the suggestion! I'll be happy to try it out next
- albatroz (7/17) May 14 2014 Too late I see, but maybe next time it will provide you a way to
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 09 2014
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
On Saturday, 10 May 2014 at 09:50:04 UTC, Jacob Carlborg wrote:On 2014-05-10 01:09, Chris Piker wrote: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. -- ChrisPhobos' 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
May 12 2014
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. -- Chrisplease help to make this happen https://github.com/D-Programming-Language/phobos/pull/2072
May 10 2014
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: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. -- ChrisPhobos' std.getopt is a bit spare for my taste, as there is no builtin general help facility with word-wrapping. ... -- Chrisplease help to make this happen https://github.com/D-Programming-Language/phobos/pull/2072
May 12 2014
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:yes please test itOn 05/10/2014 01:09 AM, Chris Piker via Digitalmars-d-learn wrote: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.)Phobos' std.getopt is a bit spare for my taste, as there is no builtin general help facility with word-wrapping. ... -- Chrisplease help to make this happen https://github.com/D-Programming-Language/phobos/pull/2072
May 12 2014
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. -- Chrisyes please test itI'm not sure what you are asking for. Would you like me to tryout getoptEx?Chrisplease help to make this happen https://github.com/D-Programming-Language/phobos/pull/2072
May 12 2014
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. -- ChrisWell, 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
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 -- ChrisOkay, 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.
May 13 2014
On Tuesday, 13 May 2014 at 17:05:15 UTC, Chris Piker wrote: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.Not sure why he had you break up the file. It should be as simple as changing the line "module std.getopt;" to something simple like "module getopt" then importing "import getopt;" and include the new file within the build. Anyway, D's libraries are not as extensive as Python/Ruby/Perl.
May 13 2014
On Wednesday, 14 May 2014 at 04:15:04 UTC, Jesse Phillips wrote:Anyway, D's libraries are not as extensive as Python/Ruby/Perl.True, but they wouldn't need to have much more to pass the good-enough threshold for me. In my current position I mostly write relatively simple server side programs. So a good logger + command line handling + cgi interface support is really enough for what I commonly do. An sftp library would be hand too, but I can find plenty of work for D to do without it. In the future I hope to investigate vibe.d, since a threaded, cross-platform, standalone server for our data would be nice to have. Cheers;
May 13 2014
On 05/14/2014 06:15 AM, Jesse Phillips via Digitalmars-d-learn wrote:On Tuesday, 13 May 2014 at 17:05:15 UTC, Chris Piker wrote:he is right, my badI 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.Not sure why he had you break up the file. It should be as simple as changing the line "module std.getopt;" to something simple like "module getopt" then importing "import getopt;" and include the new file within the build.Anyway, D's libraries are not as extensive as Python/Ruby/Perl.
May 14 2014
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 Or run the web interface (digger-web), and select the pull from the list.
May 13 2014
On Tuesday, 13 May 2014 at 12:08:51 UTC, Vladimir Panteleev wrote:On Tuesday, 13 May 2014 at 03:40:57 UTC, Chris Piker wrote:Thanks for the suggestion! I'll be happy to try it out next time I have an opportunity to use D. Unfortunately the window has closed on my current project. I just can't afford any more schedule slip. -- ChrisI 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 Or run the web interface (digger-web), and select the pull from the list.
May 13 2014
Too late I see, but maybe next time it will provide you a way to search available projects faster. On DUB http://code.dlang.org/ there is one project that looks like address the issues you had with std.getopt, "post-rock". Have not used it so I cannot give any further recommendations. Maybe you will find there others. On Friday, 9 May 2014 at 23:09:34 UTC, 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. -- Chris
May 14 2014