On Mon, 21 Mar 2011 15:42:17 +0100 Colomban Wendling <lists....@herbesfolles.org> wrote:
> > The form (-de), frequently used, fails though it is advertised > > in the Command line parser description: > > > > http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#g-option-context-add-main-entries > > > > {"debug", 'd', 0, G_OPTION_ARG_STRING, &dbg, "Debug options", "opts"}, > > why? > > This is NOT meant to work as you seem to expect, and the docs tells you: > "-de" is the same as "-d -e", not "-d e". > This is a very common thing, and most commands works this way (apart > perhaps cut). Ok... But if I put d: in getopt's arg list, I do expect an argument, and -de is parsed as -d e. Why doesn't GOptionEntry, with a specified G_OPTION_ARG_STRING do the same? > > 3) The reason I wanted to migrate to GOption, is that it seems > > gnome_program_init doesn't eliminate the recognized default arguments > > such as --g-fatal-warnings, if added. So, in gdb, a run > > --g-fatal-warnings produces an error in getopt. > > AFAIR, --g-fatal-warnings is NOT a standard option. You're expected to > use the environment variable G_DEBUG: > G_DEBUG=fatal-warnings gdb yourapp > > See http://library.gnome.org/devel/glib/unstable/glib-running.html http://library.gnome.org/devel/gtk/2.21/gtk-running.html Or doesn't GNOME pass those arguments to GTK? (BTW, gimp accepts --g-fatal-warnings) > > > I've looked through numerous pages - can anyone point to an app that > > actually uses GOption for more than a minimal options set? > > Most GNOME programs, and let's guess: GIMP ;) Strange that gimp didn't jump out with a google search. Isn't the code visible on the net? Thanks, John _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list