[Geany] Dealing with unknown command line options

Enrico Tröger enrico.troeger at xxxxx
Fri Dec 21 10:30:45 UTC 2007


On Wed, 19 Dec 2007 16:22:49 -0700, Michal Kurgan
<michal.kurgan at moloh.net> wrote:

> On Wed, 19 Dec 2007 15:59:12 -0600
> "Jeff Pohlmeyer" <yetanothergeek at gmail.com> wrote:
> 
> > On Dec 19, 2007 7:55 AM, Enrico Tröger <enrico.troeger at uvena.de>
> > wrote:
> > 
> > > I didn't find a way to get geany --version
> > > running on a text console.
> > 
> > Ooops, I had not thought of that one...
> > 
> > What if you first do a simple loop through the command
> > line options, and if you find one of these:
> > 
> >  --ft-names
> >  --print-prefix
> >  -v
> >  --version
> > 
> > Just print the requested information and exit,
> > so glib/gtk will never "see" the option.
Yes, I also thought about this but then we have to add code to manually
parse these command line options. I'd like to keep the GLib command
line parsing API but it seems it doesn't work without a display.

> Better use "gtk_init_check" to not force termination or
I did some testing with all these functions. gtk_init_check and
gtk_init_with_args return FALSE if there is no display present. If they
would parse the given command line options it would be ideally. Then we
know there is no display and though we know which command line options
were given. Unfortunately, all these functions doesn't parse the
command line options in case there is no display found. The docs
doesn't mention this clearly, IMO.
So the only possibility we have (AFAIK) is to manually parse the
commandline options(maybe with popt) but I don't want to add this. It
is a just another bunch of code for very low use, probably. Especially
because the code actually exists already in GLib.

Maybe I'm missing something.

Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.key
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/users/attachments/20071221/9ab0ef44/attachment.pgp>


More information about the Users mailing list