Revision: 2598 http://geany.svn.sourceforge.net/geany/?rev=2598&view=rev Author: eht16 Date: 2008-05-18 09:27:08 -0700 (Sun, 18 May 2008)
Log Message: ----------- Allow loading projects from command line (closes #1961083).
Modified Paths: -------------- trunk/ChangeLog trunk/doc/geany.1.in trunk/doc/geany.html trunk/doc/geany.txt trunk/src/main.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-05-18 16:08:26 UTC (rev 2597) +++ trunk/ChangeLog 2008-05-18 16:27:08 UTC (rev 2598) @@ -4,6 +4,8 @@ Force using tabs for indentation when opening Makefiles. * plugins/pluginmacros.h: Define p_editor in the right way, oops. + * doc/geany.1.in, doc/geany.html, doc/geany.txt, src/main.c: + Allow loading projects from command line (closes #1961083).
2008-05-16 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/doc/geany.1.in =================================================================== --- trunk/doc/geany.1.in 2008-05-18 16:08:26 UTC (rev 2597) +++ trunk/doc/geany.1.in 2008-05-18 16:27:08 UTC (rev 2598) @@ -17,6 +17,9 @@ A space-separated list of filenames. Absolute and relative filenames can be used. Geany also recognises line and column information when appended to the filename with colons, e.g. "geany foo.bar:10:5" will open the file foo.bar and place the cursor in line 10 at column 5. +.IP "\fB\fP \fB\fP " 10 +Projects can also be opened but a project file (*.geany) must be the first non-option argument. +All additionally given files are ignored. .IP "\fB\fP \fB+number\fP " 10 Set initial line .I number
Modified: trunk/doc/geany.html =================================================================== --- trunk/doc/geany.html 2008-05-18 16:08:26 UTC (rev 2597) +++ trunk/doc/geany.html 2008-05-18 16:27:08 UTC (rev 2598) @@ -6,7 +6,7 @@ <meta name="generator" content="Docutils 0.4.1: http://docutils.sourceforge.net/" /> <title>Geany</title> <meta name="authors" content="Enrico Tröger Nick Treleaven Frank Lanitz" /> -<meta name="date" content="2008-05-13" /> +<meta name="date" content="2008-05-14" /> <style type="text/css">
/* @@ -133,7 +133,7 @@ <br />Nick Treleaven <br />Frank Lanitz</td></tr> <tr><th class="docinfo-name">Date:</th> -<td>2008-05-13</td></tr> +<td>2008-05-14</td></tr> <tr><th class="docinfo-name">Version:</th> <td>0.15</td></tr> </tbody> @@ -591,13 +591,17 @@ </tr> <tr><td><em>none</em></td> <td>[files ...]</td> -<td>Open all given files at startup. This option causes +<td><p class="first">Open all given files at startup. This option causes Geany to ignore loading stored files from the last session (if enabled). Geany also recognises line and column information when appended to the filename with colons, e.g. "geany foo.bar:10:5" will open the file foo.bar and -place the cursor in line 10 at column 5.</td> +place the cursor in line 10 at column 5.</p> +<p class="last">Projects can also be opened but a project file (*.geany) +must be the first non-option argument. All additionally +given files are ignored.</p> +</td> </tr> </tbody> </table> @@ -4107,7 +4111,7 @@ <div class="footer"> <hr class="footer" /> <a class="reference" href="geany.txt">View document source</a>. -Generated on: 2008-05-14 14:29 UTC. +Generated on: 2008-05-18 16:23 UTC. Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>
Modified: trunk/doc/geany.txt =================================================================== --- trunk/doc/geany.txt 2008-05-18 16:08:26 UTC (rev 2597) +++ trunk/doc/geany.txt 2008-05-18 16:27:08 UTC (rev 2598) @@ -243,6 +243,10 @@ appended to the filename with colons, e.g. "geany foo.bar:10:5" will open the file foo.bar and place the cursor in line 10 at column 5. + + Projects can also be opened but a project file (*.geany) + must be the first non-option argument. All additionally + given files are ignored. ============ ======================= =================================================
Geany supports all generic GTK options, a list is available on the
Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2008-05-18 16:08:26 UTC (rev 2597) +++ trunk/src/main.c 2008-05-18 16:27:08 UTC (rev 2598) @@ -754,6 +754,7 @@ { gint idx; gint config_dir_result; + gboolean load_project_from_cl = FALSE;
app = g_new0(GeanyApp, 1); memset(&main_status, 0, sizeof(GeanyStatus)); @@ -877,13 +878,18 @@ /* load keybinding settings after plugins have added their groups */ keybindings_load_keyfile();
+ load_project_from_cl = (argc > 1) && g_str_has_suffix(argv[1], ".geany"); + /* load any command line files or session files */ main_status.opening_session_files = TRUE; - if (! open_cl_files(argc, argv)) + if (load_project_from_cl || ! open_cl_files(argc, argv)) { if (prefs.load_session && cl_options.load_session) { - load_project_file(); + if (load_project_from_cl) + project_load_file(argv[1]); + else + load_project_file();
/* load session files into tabs, as they are found in the session_files variable */ configuration_open_files();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.