Comment 15 for bug 1226227

Revision history for this message
Michael Terry (mterry) wrote :

> To be clear program_options may be private, but it is passed to parse_options() which could be overridden so that you can parse argv yourself.

Yes, you have access to the stated options. And you can access argv/argc yourself (if you save them, since they are private in DefaultServerConfiguration). But you still have the problem that you can't change the contents of the ProgramOption class.

The only fix I can think of is to override the_options() to create our own class to replace ProgramOption (say, UnityMirOption), *but* still call the DefaultServerConfiguration version so that we can access program_options in parse_options(), which we would override to do our non-aborting parsing.

We'd still have to reproduce a lot of parsing code that happens in that call manually, because it happens in non-class functions. Additionally, we could either reproduce the environment/file parsing that ProgramOption has or let it parse the environment/file but then iterate over its contents and grab each set option and stuff them into our UnityMirOption version.

So I think it's possible to fix as-is. But super awkward. If we're looking at the long term, surely we can do better.