Factor out StringChoiceOption
commit94c4c95d9c29748e4b98c0d4fa2533814832b7ca
authorJon Turney <jon.turney@dronecode.org.uk>
Sun, 18 Jul 2021 14:11:39 +0000 (18 15:11 +0100)
committerJon Turney <jon.turney@dronecode.org.uk>
Tue, 28 Sep 2021 13:59:47 +0000 (28 14:59 +0100)
tree085a6f5e85d25c7aa70894e3a68a69bf9f11a97e
parentb60d80c64bc08556b4030cc5498493a9a9820145
Factor out StringChoiceOption

Factor out logic for 'a string option which is one of a set of choices'
from CompactOsStringOption as StringChoiceOption.

v2:
Allow different behaviour for option without a choice, and option absent.

Future work: This doesn't say anything other that "Error during option
processing" if you've given an invalid choice string, or left it out
when it's required, because libgetopt++ doesn't output anything, just
returns success or failure after processing the command line arguments.
io_stream_cygfile.cc
libgetopt++/Makefile.am
libgetopt++/include/getopt++/StringChoiceOption.h [new file with mode: 0644]
libgetopt++/src/StringChoiceOption.cc [new file with mode: 0644]