G_OPTION_ARG_NONE GOptionEntry with arg_description set generates misleading help message
@bob131
Submitted by bob Link to original bug (#770867)
Description
If one were to create a GOptionEntry with the argument type set as G_OPTION_ARG_NONE, a pointer to a gboolean /and/ specify arg_description, the generated help for the option looks the same as it would with a different G_OPTION_ARG_* set, eg:
-b, --bool=test
Perhaps this in itself isn't so bad, but if the program is invoked with the long-form-with-equals variant (--bool=test), the 'test' part is completely ignored by the parser.
My proposed fix is two-fold:
- Change '--bool=test' in the help output to '--bool test'
- If the with-equals form is used anyway, add the supplied string to the G_OPTION_REMAINING argument array.
I'll look into submitting a patch for this, but my C is kind of rubbish so I mightn't be able to.
Version: 2.49.x