Re: popt in Gnome2::Program

On Mon, 2004-09-13 at 22:40, Peter Oliver wrote:

The catch is that Gnome spots the --help option, displays help text 
about the default Gnome options, and exits.  You can't get the usage 
message straight from the pod with
     pod2usage( -verbose => 1 ) if $option{'help'};

Yeah.  C applications usually create a popt table and pass it to
gnome_program_init via the GNOME_PARAM_POPT_TABLE property.  If init
sees --help, it prints out those options under "Application options",
and all the library options after that.

So, is there neat solution to this?  The best I've come up with is to put

     if ( grep { s/^-h$/--help/; m/^-(-help|\?)$/ } @ARGV ) {
         system $0, '--podhelp';

Couldn't you just print your help stuff here and call
Gnome2::Program->init nevertheless?  That would come quite close to what
the popt table stuff does: the application options are printed first,
followed by the library options.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]