Ticket #528 (assigned enhancement)

Opened 3 years ago

Last modified 2 years ago

getopt() c-lib function should be replaced with boost::program_options C++ function

Reported by: smann Owned by: UnAssigned
Priority: medium Milestone:
Component: configuration Keywords:
Cc: CVSS Scoring:
Sensitive: no Defect Severity: N/A
Sub-Project: DNS Feature Depending on Ticket:
Estimated Difficulty: 0.0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

Throughout the BIND 10 C++ code, getopt is used (probably because it is portable). But this raises an inconsistency in the command line options since getopt() cannot handle long options (e.g. --user=foo) while the python getopt() function can. Further, boost::program_options provides a fairly abstract mechanism for retrieving key/value pairs from either the command line or a file. See  http://www.boost.org/doc/libs/1_45_0/doc/html/program_options.html for details.

Change History

comment:1 Changed 3 years ago by jinmei

As far as I know, boost program_options required compiled boost library.
Does it change in a recent version of boost? If not, we should be
more careful before using it.

comment:2 Changed 3 years ago by jelte

hmz, and getopt_long is a gnu extension. Anyone incredibly opposed to use-if-available?

btw, any specific reason this ticket got assigned to me?

comment:3 Changed 3 years ago by jelte

  • Owner changed from jelte to UnAssigned
  • Status changed from new to assigned

I'm not saying I don't want to take on this ticket, but I think it got assigned to me by accident :)

comment:4 Changed 2 years ago by shane

  • Sub-Project set to DNS
  • Defect Severity set to N/A

See also ticket #1256.

Note: See TracTickets for help on using tickets.