Danek Duvall wrote: > On Sun, Oct 12, 2008 at 08:06:48PM -0500, Shawn Walker wrote: > >> --proxy-base already works that way because of SMF's annoying built-in >> limitations for options. > > I'm not sure how. You assume in the code that an argument is given to > --proxy-base. > >> I don't consider it to be syntactically ambiguous, but however. > > How's this: > > pkg.depotd --content-root --mirror > > Does that set the value of content-root to "--mirror", or does it set the > value of content-root to be the built-in default?
The latter thanks to long options parsing (I wish it would force --blah=foo as the syntax). With the long-options parsing, it apparently sees --mirror *as* the value to --content-root. Which means I am unable to tell the difference between this: ./depot.py --content-root --mirror ...and this: ./depot.py --content-root /foo ...except that I throw an error if the directory doesn't exist during startup. >> In this case, since I can put a sane default in the SMF xml, I'm willing to >> change it to not permit "" as an argument value. > > Wait -- do you mean that "" as an argument to the option is, in your terms, > a "not specifying a value"? > > If so, that's fine. But some argument is required. Well, here's the ugly and uglier: ./depot.py ... --content-root ...will cause getopt to raise an error about it requiring an argument. ./depot.py ... --content-root= ...will cause getopt to return the arg but have it's value set as "". Which leaves us to do something with it. Cheers, -- Shawn Walker _______________________________________________ pkg-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
