zsh-users
 help / color / mirror / code / Atom feed
* getopts and long options
@ 2005-08-30 10:16 DervishD
  2005-08-30 13:55 ` Doug Kearns
  0 siblings, 1 reply; 3+ messages in thread
From: DervishD @ 2005-08-30 10:16 UTC (permalink / raw)
  To: Zsh Users

    Hi all :)

    I have a script which needs to receive a set of highly related
options. This can be implemented using the "getopts" builtin, using
arguments to options and parsing the argument afterwards, but the
best solution is to use long options (in this case, two letter
options). Unfortunately, "getopts" doesn't support long options and
I'm forced to use GNU getopt :(

    I would prefer to use the "getopts" builtin if possible, rather
than GNU getopt, to avoid a dependency, so: is there any 'trick' for
"getopts" to make it accept long options or must I use GNU getopt?

    Thanks a lot in advance :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: getopts and long options
  2005-08-30 10:16 getopts and long options DervishD
@ 2005-08-30 13:55 ` Doug Kearns
  2005-08-30 14:20   ` DervishD
  0 siblings, 1 reply; 3+ messages in thread
From: Doug Kearns @ 2005-08-30 13:55 UTC (permalink / raw)
  To: Zsh Users

On Tue, Aug 30, 2005 at 12:16:04PM +0200, DervishD wrote:

<snip>
 
>     I would prefer to use the "getopts" builtin if possible, rather
> than GNU getopt, to avoid a dependency, so: is there any 'trick' for
> "getopts" to make it accept long options or must I use GNU getopt?

Have a look at zparseopts.
 
Regards,
Doug


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: getopts and long options
  2005-08-30 13:55 ` Doug Kearns
@ 2005-08-30 14:20   ` DervishD
  0 siblings, 0 replies; 3+ messages in thread
From: DervishD @ 2005-08-30 14:20 UTC (permalink / raw)
  To: Zsh Users

    Hi Doug :)

 * Doug Kearns <dougkearns@gmail.com> dixit:
> On Tue, Aug 30, 2005 at 12:16:04PM +0200, DervishD wrote:
> >     I would prefer to use the "getopts" builtin if possible, rather
> > than GNU getopt, to avoid a dependency, so: is there any 'trick' for
> > "getopts" to make it accept long options or must I use GNU getopt?
> Have a look at zparseopts.

    I think I've already told in this list that sometimes (quite
frequently, lately) I'm a dumbass. Well, in my defense I'll say that
I thought that zparseopts was a contribution script and I don't
wanted to ship my script with a dependency on another script. But it
is a builtin and I'm a dumbass...

    Thanks for pointing, Doug, otherwise I would have written a
parser for long options or used GNU getopt O:) Thanks a lot, really.

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-08-30 14:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-30 10:16 getopts and long options DervishD
2005-08-30 13:55 ` Doug Kearns
2005-08-30 14:20   ` DervishD

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).