Le lundi 11 juillet 2005 à 09:56 +0300, Tommi Hassinen a écrit : > On Fri, 8 Jul 2005, Michael Banck wrote: > > > Is the -f option really needed? Unix tradition mostly considers any > > non-option arguments as file names, so maybe this could be used here as > > well? > > In gtk/gnome programs there are many built-in options provided bny those > libraries ; for example v1.02 says with "--help" something like this: > > $ ghemical --help > Usage: ghemical [OPTION...] > > GNOME options > --disable-sound Disable sound server usage > --enable-sound Enable sound server usage > --espeaker=HOSTNAME:PORT Host:port on which the sound server to use is > running > --version > > Help options > -?, --help Show this help message > --usage Display brief usage message > > GTK options > --gdk-debug=FLAGS Gdk debugging flags to set > --gdk-no-debug=FLAGS Gdk debugging flags to unset > --display=DISPLAY X display to use > --sync Make X calls synchronous > --no-xshm Don't use X shared memory extension > --name=NAME Program name as used by the window manager > --class=CLASS Program class as used by the window manager > --gxid_host=HOST > --gxid_port=PORT > --xim-preedit=STYLE > --xim-status=STYLE > --gtk-debug=FLAGS Gtk+ debugging flags to set > --gtk-no-debug=FLAGS Gtk+ debugging flags to unset > --g-fatal-warnings Make all warnings fatal > --gtk-module=MODULE Load an additional Gtk module > > GNOME GUI options > --disable-crash-dialog > > Session management options > --sm-client-id=ID Specify session management ID > --sm-config-prefix=PREFIX Specify prefix of saved configuration > --sm-disable Disable connection to session manager > > ghemical options > -f, --file=filename open file > -i, --import=filename import file as gpr > > So I think it is OK to make the arguments a bit specific like this. Also > one can separate "open file" and "import file" using -f and -i (if > needed). > > In v1.0x the arguments are added using "popt-gnome" or something like > that. The same stuff can be copied in v1.5x but does anyone know how it's > done with GTK2? Is the library still called "popt"? There is some new code in GLib. The documentation is located at: file:///usr/share/gtk-doc/html/glib/glib-Commandline-option-parser.html on my machine. -- Jean Bréfort <jean.brefort at normalesup.org>