Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #171332
| From | Keith Thompson <Keith.S.Thompson+u@gmail.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Commandline parsing |
| Date | 2023-07-27 02:47 -0700 |
| Organization | None to speak of |
| Message-ID | <878rb1ptyb.fsf@nosuchdomain.example.com> (permalink) |
| References | <a631f98c-5482-4e90-9a0d-8ce49e447153n@googlegroups.com> <u9s6me$1k44g$1@dont-email.me> <u9s7l3$1k437$1@dont-email.me> <c092bdea-d2d1-4434-8a92-31da87d99c6cn@googlegroups.com> |
Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
> On Wednesday, 26 July 2023 at 23:45:06 UTC+1, Lynn McGuire wrote:
>> On 7/26/2023 5:28 PM, Lynn McGuire wrote:
>> > On 7/26/2023 10:34 AM, Malcolm McLean wrote:
>> >> Just realised that my options parser isn't publically available, which
>> >> I have just remedied.
>> >>
>> >> What approaches do people use towards parsing commandline options ? Do
>> >> you use getopt() ? Or do you find that real world programs have a
>> >> simple enough set of options that it's easier to write bespoke code?
>> >
>> > And what do you do about Unicode on your command line ?
>> >
>> > Lynn
>> BTW, we rolled our own command line parser that handles Unicode.
>>
> You'd need to tweak the options parser slightly because it has a
> concept of single character flags (so the user types something like
> "tar -xvf file.tar" he's not passing one option "xvf", but three
> flags). So it would have to be UTF-8 aware to accomodate Unicode
> flags. Long options should work tranparently. It's maybe a worthwhile
> change.
I've never seen an option name that uses non-ASCII characters. The vast
majority of option names use just letters, mostly lowercase --
sometimes digits, and hyphens or rarely underscores for long option
names.
Handling full UTF-8 for *arguments* to options is useful. Requiring
non-ASCII characters as option names is going to make commands difficult
to type for a lot of users.
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Commandline parsing Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2023-07-26 08:34 -0700
Re: Commandline parsing Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2023-07-26 15:38 +0000
Re: Commandline parsing scott@slp53.sl.home (Scott Lurndal) - 2023-07-26 16:00 +0000
Re: Commandline parsing Spiros Bousbouras <spibou@gmail.com> - 2023-07-26 16:17 +0000
Re: Commandline parsing gazelle@shell.xmission.com (Kenny McCormack) - 2023-07-26 16:22 +0000
Re: Commandline parsing Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2023-07-26 09:26 -0700
Re: Commandline parsing Lynn McGuire <lynnmcguire5@gmail.com> - 2023-07-26 17:28 -0500
Re: Commandline parsing Lynn McGuire <lynnmcguire5@gmail.com> - 2023-07-26 17:44 -0500
Re: Commandline parsing Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2023-07-27 01:46 -0700
Re: Commandline parsing Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-07-27 02:47 -0700
Re: Commandline parsing Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2023-07-27 03:12 -0700
Re: Commandline parsing Kaz Kylheku <864-117-4973@kylheku.com> - 2023-07-27 00:32 +0000
Re: Commandline parsing Spiros Bousbouras <spibou@gmail.com> - 2023-07-27 16:17 +0000
Re: Commandline parsing Blue-Maned_Hawk <bluemanedhawk@gmail.com> - 2023-07-27 04:00 -0400
Re: Commandline parsing Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2023-07-27 01:39 -0700
Re: Commandline parsing Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-07-27 02:47 -0700
Re: Commandline parsing Kaz Kylheku <864-117-4973@kylheku.com> - 2023-07-27 17:29 +0000
Re: Commandline parsing fir <profesor.fir@gmail.com> - 2023-07-31 08:28 -0700
Re: Commandline parsing scott@slp53.sl.home (Scott Lurndal) - 2023-07-31 16:32 +0000
Re: Commandline parsing fir <profesor.fir@gmail.com> - 2023-07-31 09:43 -0700
Re: Commandline parsing Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2023-07-31 09:46 -0700
Re: Commandline parsing fir <profesor.fir@gmail.com> - 2023-07-31 10:12 -0700
Re: Commandline parsing fir <profesor.fir@gmail.com> - 2023-07-31 11:21 -0700
Re: Commandline parsing fir <profesor.fir@gmail.com> - 2023-07-31 12:37 -0700
Re: Commandline parsing fir <profesor.fir@gmail.com> - 2023-07-31 12:57 -0700
Re: Commandline parsing fir <profesor.fir@gmail.com> - 2023-07-31 13:17 -0700
Re: Commandline parsing fir <profesor.fir@gmail.com> - 2023-08-01 08:39 -0700
Re: Commandline parsing fir <profesor.fir@gmail.com> - 2023-08-01 09:00 -0700
Re: Commandline parsing fir <profesor.fir@gmail.com> - 2023-08-01 10:49 -0700
Re: Commandline parsing fir <profesor.fir@gmail.com> - 2023-07-31 11:53 -0700
Re: Commandline parsing Michael S <already5chosen@yahoo.com> - 2023-07-31 12:47 -0700
Re: Commandline parsing Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2023-08-02 16:30 -0600
csiph-web