Support local OptionEntry arrays with nice syntax
@alexl
Submitted by Alexander Larsson Link to original bug (#657690)
Description
Currently to use GOption you do something like:
private static string individual_id = null; private const OptionEntry[] options = { { "individual", 'i', 0, OptionArg.STRING, ref individual_id, N_("Show contact with this individual id"), null }, { null } };
This works, but it requires global variables (statics) which is not so nice for e.g. the GApplication.command_line call which can be run multiple times, etc.
You can get similar syntax using local const variables, but the reference to the local variables (ref individual_id above) is not const so this doesn't work.