Re: Argon: an alternative parser for command-line arguments

2019-01-26 Thread Victor Porton via Digitalmars-d-announce
On Wednesday, 9 March 2016 at 18:56:10 UTC, Markus Laker wrote: To support git-style syntax while using Argon, I'd do this: 1. Find the (possibly empty) initial sequence of tokens that start with a dash. Pass them to an Argon-derived class which we'll call `Stem', which parses them. 2. If

Re: Argon: an alternative parser for command-line arguments

2018-07-05 Thread Jim Balter via Digitalmars-d-announce
On Thursday, 3 March 2016 at 09:33:38 UTC, Johannes Pfau wrote: Am Thu, 03 Mar 2016 09:09:38 + schrieb Markus Laker : * It can open files specified at the command line. It can do a simplified version of what cat(1) does and many Perl programs so, and open a file specified by the user or

Re: Argon: an alternative parser for command-line arguments

2016-03-10 Thread karabuta via Digitalmars-d-announce
On Wednesday, 9 March 2016 at 18:56:10 UTC, Markus Laker wrote: On Saturday, 5 March 2016 at 16:28:25 UTC, karabuta wrote: I think he meant: [git status --help], where you have three attributes with the last one being the flag. So in addition to: [status --help] by default, you also have: [git

Re: Argon: an alternative parser for command-line arguments

2016-03-09 Thread Markus Laker via Digitalmars-d-announce
On Saturday, 5 March 2016 at 16:28:25 UTC, karabuta wrote: I think he meant: [git status --help], where you have three attributes with the last one being the flag. So in addition to: [status --help] by default, you also have: [git status --help] to get help on status only. Odd: I wrote a

Re: Argon: an alternative parser for command-line arguments

2016-03-05 Thread karabuta via Digitalmars-d-announce
On Friday, 4 March 2016 at 17:34:08 UTC, Markus Laker wrote: On Friday, 4 March 2016 at 12:21:25 UTC, Jacob Carlborg wrote: No, I mean a longer description, more like documentation. Look at the help for git when using --help, it has different behavior than -h. The first one is more like a man

Re: Argon: an alternative parser for command-line arguments

2016-03-04 Thread Markus Laker via Digitalmars-d-announce
On Friday, 4 March 2016 at 12:21:25 UTC, Jacob Carlborg wrote: No, I mean a longer description, more like documentation. Look at the help for git when using --help, it has different behavior than -h. The first one is more like a man page. Ah, I see. Sorry for the misunderstanding. An app

Re: Argon: an alternative parser for command-line arguments

2016-03-04 Thread Jacob Carlborg via Digitalmars-d-announce
On 2016-03-03 21:55, Markus Laker wrote: Yes. You can give an option a description, like this: // ... uint nr_doors; // ... Named("doors", nr_doors, 0) ("number of doors").AddRange(1, 4); If you do this, the user has a nice, short name to type: --doors 2 But the description will be used in

Re: Argon: an alternative parser for command-line arguments

2016-03-03 Thread Andrei Alexandrescu via Digitalmars-d-announce
On 03/03/2016 04:09 AM, Markus Laker wrote: On Thursday, 3 March 2016 at 01:52:11 UTC, Chris Wright wrote: You might want to take a minute to shill it here. What's great about it? OK. :-) [snip] Very nice! I think we should adopt some of these ideas for std.getopt as well. -- Andrei

Re: Argon: an alternative parser for command-line arguments

2016-03-03 Thread Markus Laker via Digitalmars-d-announce
On Thursday, 3 March 2016 at 15:08:37 UTC, Jacob Carlborg wrote: Does it support some longer documentation for the flags, i.e. "git status -h" vs "git status --help"? Yes. You can give an option a description, like this: // ... uint nr_doors; // ... Named("doors", nr_doors, 0) ("number of

Re: Argon: an alternative parser for command-line arguments

2016-03-03 Thread Markus Laker via Digitalmars-d-announce
On Thursday, 3 March 2016 at 09:33:38 UTC, Johannes Pfau wrote: The rest of this list sounds quite good, but please reconsider automatically opening files: https://media.ccc.de/v/32c3-7130-the_perl_jam_2 I guess the scenario can't happen in D as our open file methods won't execute programs

Re: Argon: an alternative parser for command-line arguments

2016-03-03 Thread Markus Laker via Digitalmars-d-announce
On Thursday, 3 March 2016 at 04:48:42 UTC, Jason White wrote: I was also dissatisfied with std.getopt and wrote a command line argument parser (competition!): https://github.com/jasonwhite/darg Though it's not quite feature-complete yet, it does everything I need it to. It uses

Re: Argon: an alternative parser for command-line arguments

2016-03-03 Thread Nick Sabalausky via Digitalmars-d-announce
On 03/02/2016 02:50 PM, Markus Laker wrote: https://github.com/markuslaker/Argon Let me know if you do something interesting with it. Markus Reminds me of one I used years ago for C#: I like the approach, it's a good one. Getopt by comparison, while very good, always seemed like a kludge

Re: Argon: an alternative parser for command-line arguments

2016-03-03 Thread Jacob Carlborg via Digitalmars-d-announce
On 2016-03-02 20:50, Markus Laker wrote: https://github.com/markuslaker/Argon Let me know if you do something interesting with it. Does it support some longer documentation for the flags, i.e. "git status -h" vs "git status --help"? -- /Jacob Carlborg

Re: Argon: an alternative parser for command-line arguments

2016-03-03 Thread Johannes Pfau via Digitalmars-d-announce
Am Thu, 03 Mar 2016 09:09:38 + schrieb Markus Laker : > * It can open files specified at the command line. It can do a > simplified version of what cat(1) does and many Perl programs so, > and open a file specified by the user or fall back to reading > from stdin.

Re: Argon: an alternative parser for command-line arguments

2016-03-03 Thread Markus Laker via Digitalmars-d-announce
On Thursday, 3 March 2016 at 04:48:42 UTC, Jason White wrote: Looks nice! Can it support sub-commands (e.g., git status)? I suppose that can be done by passing through unused arguments and parsing those again. Yes, that's what I'd do. Also, you'll get more users if it's a dub package and on

Re: Argon: an alternative parser for command-line arguments

2016-03-03 Thread Markus Laker via Digitalmars-d-announce
On Thursday, 3 March 2016 at 01:52:11 UTC, Chris Wright wrote: You might want to take a minute to shill it here. What's great about it? OK. :-) * It parses positional parameters, error-checks them and places them into type-safe variables: it doesn't just pick out named --switches and then

Re: Argon: an alternative parser for command-line arguments

2016-03-02 Thread Jason White via Digitalmars-d-announce
On Wednesday, 2 March 2016 at 19:50:30 UTC, Markus Laker wrote: https://github.com/markuslaker/Argon Let me know if you do something interesting with it. Markus Looks nice! Can it support sub-commands (e.g., git status)? I suppose that can be done by passing through unused arguments and

Re: Argon: an alternative parser for command-line arguments

2016-03-02 Thread Chris Wright via Digitalmars-d-announce
On Wed, 02 Mar 2016 19:50:30 +, Markus Laker wrote: > https://github.com/markuslaker/Argon > > Let me know if you do something interesting with it. > > Markus You might want to take a minute to shill it here. What's great about it? How do I use it? Why should I use it instead of