* Fhpd Commands option parsing
@ 2007-07-26 20:24 Nurdin Premji
2007-07-26 20:36 ` Andrew Cagney
0 siblings, 1 reply; 2+ messages in thread
From: Nurdin Premji @ 2007-07-26 20:24 UTC (permalink / raw)
To: Frysk List
I am creating a small option parser based on the getopt option parser
for fhpd commands, (okay so the only thing being carried over is the
Options class). I want to avoid having to do too many fancy things to
add extra options, I like the ability to say parser.addOption and have
it know what to do. I'd also like a standard help option for each
command that doesn't exit the fhpd when run.
I'm making a few assumptions about the possible options for the fhpd
internal commands:
1. All options are at the end.
I.e. command [parameters ...] [options ...]
2. No option has arguments.
Are these safe assumptions? Are there more I can count on?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Fhpd Commands option parsing
2007-07-26 20:24 Fhpd Commands option parsing Nurdin Premji
@ 2007-07-26 20:36 ` Andrew Cagney
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cagney @ 2007-07-26 20:36 UTC (permalink / raw)
To: Nurdin Premji; +Cc: Frysk List
Nurdin Premji wrote:
> I am creating a small option parser based on the getopt option parser
> for fhpd commands, (okay so the only thing being carried over is the
> Options class). I want to avoid having to do too many fancy things to
> add extra options, I like the ability to say parser.addOption and have
> it know what to do. I'd also like a standard help option for each
> command that doesn't exit the fhpd when run.
>
> I'm making a few assumptions about the possible options for the fhpd
> internal commands:
> 1. All options are at the end.
> I.e. command [parameters ...] [options ...]
> 2. No option has arguments.
>
> Are these safe assumptions? Are there more I can count on?
>
Well you can delete #2 :-(
print -x -format x
from memory (print "x" negated as hex?). An equivalent to "--" to halt
option parsing might help.
Andrew
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-07-26 20:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-26 20:24 Fhpd Commands option parsing Nurdin Premji
2007-07-26 20:36 ` Andrew Cagney
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 read-only IMAP folder(s) and NNTP newsgroup(s).