BIND 10 #1256: Minor error in getopt() processing
BIND 10 Development
do-not-reply at isc.org
Mon Nov 7 15:49:32 UTC 2011
#1256: Minor error in getopt() processing
-------------------------------------+-------------------------------------
Reporter: shane | Owner:
Type: | Status: new
defect | Milestone: Year 3 Task
Priority: | Backlog
trivial | Resolution:
Component: | Sensitive: 0
b10-auth | Sub-Project: DNS
Keywords: | Estimated Difficulty: 0
Defect Severity: Low | Total Hours: 0
Feature Depending on Ticket: |
Add Hours to Ticket: 0 |
Internal?: 0 |
-------------------------------------+-------------------------------------
Comment (by shane):
Replying to [comment:3 jreed]:
> So do you want to check for : (in the case) instead or get rid of the
colon (in the getopt)?
I'd like to keep the ':' check which we have in the getopt() function call
argument, and make the switch statement following it also check for ':' -
instead of '?'.
> Do we want it to complain about the unknown option or not (in addition
to giving the usage statement)?
Yes, we do.
> Note that the src/bin/dhcp6/main.cc uses the colon and checks for the
colon, but doesn't yet have any switches that have an option argument.
Okay, I think this is probably okay as it won't hurt anything, and may
help prevent forgetting it!
> The colon magic, in my opinion, is not good as it also loses the
explanation specific to the problem, such as b10-auth: option requires an
argument -- u
Yeah, the problem is that the default message is ugly and non-helpful.
Straight from 1971, I think. :)
Ideally we would use a more modern replacement for getopt(), I think that
this ticket may need to investigate that possibility. I see that there is
boost::program_options, which may be what we want to use.
http://www.boost.org/doc/libs/1_37_0/doc/html/program_options.html
--
Ticket URL: <http://bind10.isc.org/ticket/1256#comment:4>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list