On Thursday, 22 December 2016 at 07:33:42 UTC, Ali Çehreli wrote:
On 12/21/2016 07:59 PM, Jon Degenhardt wrote:
> construct the 'opts' parameter from
> definitions stored in two or more files. The reason for doing
this is to
> create a customization mechanism where-by there are a number
of default
> capabilities built-in to the main code base, but someone can
customize
> their copy of the code, putting definitions in a separate
file, and have
> it added in at compile time, including modifying command line
arguments.
I'm not sure this is any better than your mixin solution but
getopt can be called multiple times on the same arguments. So,
for example common code can parse them for its arguments and
special code can parse them for its arguments. [...]
Yes, that might work, thanks. I'll need to work on the code
structure a bit (there are a couple other nuances to account
for), but might be able to make it work. The mixin approach feels
a bit brittle.
--Jon