[Geany-Devel] Accessing argv from plugins

Colomban Wendling lists.ban at herbesfolles.org
Mon Jan 7 15:19:05 UTC 2013

Le 07/01/2013 10:25, Matthew Brush a écrit :
> Hi,
> I want to write a plugin that requires some command line options passed
> to it (through geany). Is there a way to make it so Geany will accept
> arbitrary arguments and then I can pick them out of /proc/<PID>/cmdline
> or something[1]? I tried but Geany currently errors out if it sees an
> option it does not recognize itself.
> Assuming this is not possible currently, is there any sane way to pass
> arguments to plugins, maybe something like how you can pass `-Wl` to GCC
> to pass-through linker args or `-X` to valac to pass-through compiler args?

It's not currently possible, but if you want to implement this, using
GOption's groups is the way to go.  Though, we parse arguments long
before loading the plugins, so maybe it'd be a bit hard to make it fit…
 however, IIRC it's totally possible not to error out on unknown
arguments and then it'd be possible to re-parse what's left in argv
after deciding whether or not to load plugins.

Though, of course CL args are great, but why do you plugin need them?
Just curious.


> Cheers,
> Matthew Brush
> [1] I'm not opposed to hacks or Linux-specific workarounds.
> _______________________________________________
> Devel mailing list
> Devel at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/devel

More information about the Devel mailing list