GNOME Bugzilla – Bug 336146
Change from popt to GOption parsing
Last modified: 2006-12-21 22:46:19 UTC
http://live.gnome.org/GnomeGoals/PoptGOption
Created attachment 62086 [details] [review] GOption patch I did the src/main.c one first, the struct definition could probably be moved back into place at the top instead of inline. 6 of 1 .... I really dislike that GOption doesn't let you set a value to be used if a option is used on the cmd line like popt does.
I guess we're okay with HEAD depending on GTK 2.6.2 or later... Seems okay to me, but configure.in would need updating.
This doesn't compile for me: main.c:447: error: ‘GNOME_PARAM_GOPTION_CONTEXT’ undeclared (first use in this function) * I agree it would be nice to get the src/main.c definition back into place at the top. * Why did the default for seahorse-daemon change from daemonize to not-daemonize? * Why do we set |import|, |encrypt| and all those guys only to then use them to set |mode|. If we're gonna have 6 flag variables, then we may as well use them directly.
(In reply to comment #3) > This doesn't compile for me: > > main.c:447: error: ‘GNOME_PARAM_GOPTION_CONTEXT’ undeclared (first use in > this function) Yeah, you need GNOME 2.14 to have that defined. > * I agree it would be nice to get the src/main.c definition back into place > at the top. I'll work on this. > * Why did the default for seahorse-daemon change from daemonize to > not-daemonize? It's not that the default changed, just the test changed from true to false because GOption only sets booleans to true if the flag is set. It's retarded but that's how it does it. > * Why do we set |import|, |encrypt| and all those guys only to then use them > to set |mode|. If we're gonna have 6 flag variables, then we may as well use > them directly. I'll change that, I was thinking the same thing. Boo GOption not being able to indicate which value to set. Maybe we ought to file this bug away and file a bug with glib/GOption to allow the setting of a specified value.
(In reply to comment #4) > (In reply to comment #3) > > main.c:447: error: ‘GNOME_PARAM_GOPTION_CONTEXT’ undeclared (first use in > > this function) > > Yeah, you need GNOME 2.14 to have that defined. Yes, this particular box has GNOME 2.12. If there really is no way around this, then I guess no GOption for seahorse. > > * Why did the default for seahorse-daemon change from daemonize to > > not-daemonize? > > It's not that the default changed, just the test changed from true to false > because GOption only sets booleans to true if the flag is set. It's retarded > but that's how it does it. Bummer, this breaks backwards compatibility. Again if there really is no way to do this, then I guess we'll have to stay with popt style parsing.
(In reply to comment #5) > Bummer, this breaks backwards compatibility. Again if there really is no way to > do this, then I guess we'll have to stay with popt style parsing. > ?? -d works like it always has for me.
Ah, I see. Well if you change the meaning of g_daemonize, then can you rename the variable to reflect what it's doing?
adam, nate, any news here to get some progress on this gnome goal?
Looks good to go now.... Although the patch will need to be brought up to date.
(and i guess that configure.in should also include the libgnome-2.14 requirement)
2006-12-21 Nate Nielsen <nielsen@memberwebs.com> * agent/seahorse-agent-main.c: * daemon/seahorse-daemon.c: * plugins/nautilus/seahorse-pgp-preferences.c: * plugins/nautilus/seahorse-tool.c: Use GOption for parsing command line arguments. Fixes bug #336146
thanks for getting this in; i updated http://live.gnome.org/GnomeGoals/PoptGOption