> 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.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1226227

Title:
  libmirserver parses arguments and fails if it's not something it
  understands

To manage notifications about this bug go to:
https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to