[Geany] Dealing with unknown command line options

Enrico Tröger enrico.troeger at xxxxx
Wed Dec 19 13:55:42 UTC 2007


On Tue, 18 Dec 2007 15:15:24 -0600, "Jeff Pohlmeyer"
<yetanothergeek at gmail.com> wrote:

> I notice that Geany doesn't handle unknown command line options
> the way most other programs do:
> 
> % nedit --no-such-option
> NEdit: Unrecognized option --no-such-option
> 
> % nano --no-such-option
> nano: unrecognized option `--no-such-option'
> 
> % geany --no-such-option
> Will create a new document named "--no-such-option"
> 
> Even more strange, with an already running instance of Geany:
> 
> % geany -i --no-such-option
> Gives me two new documents, one named "--no-such-option" and one
> named "-i" ?!?!
> 
> I think this patch should solve the problem...
Thank you very much.
I moved the gtk_init() call into parse_command_line_options() and used
gtk_init_with_args(). This doesn't change much but so we get the
"cannot open display" warning using the g_printerr call and we can save
all the code to create an own g_option_context.

Unfortunately, when using GLib's command line parsing API there seems
to be no way to get it working without a valid display(means graphic
user interface, running XServer). I didn't find a way to get geany
--version running on a text console. I guess to be able to get it
working we need to use getopt or parse the command line options
completely by hand. But since Geany is a GUI-only application it isn't
probably that important.

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/20071219/c886d018/attachment.pgp>


More information about the Users mailing list