r4039 - trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src

mickey at sita.openmoko.org mickey at sita.openmoko.org
Sun Feb 10 15:47:50 CET 2008


Author: mickey
Date: 2008-02-10 15:47:50 +0100 (Sun, 10 Feb 2008)
New Revision: 4039

Modified:
   trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/mainwindow.vala
Log:
openmoko-terminal: handle -x option


Modified: trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/mainwindow.vala
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/mainwindow.vala	2008-02-10 14:09:19 UTC (rev 4038)
+++ trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/mainwindow.vala	2008-02-10 14:47:50 UTC (rev 4039)
@@ -37,6 +37,7 @@
     private ToolButton btn_paste;
 
     private static string initial_command;
+    private static string[] initial_command_line;
 
     public MainWindow()
     {
@@ -206,7 +207,8 @@
     }
 
     const OptionEntry[] options = {
-        { "command", 'e', 0, OptionArg.STRING, out initial_command, "Execute COMMAND inside the terminal.", "COMMAND"},
+        { "command", 'e', 0, OptionArg.STRING, out initial_command, "Execute COMMAND inside the terminal.", "COMMAND" },
+        { "", 'x', 0, OptionArg.STRING_ARRAY, out initial_command_line, "Execute remainder of command line inside the terminal.", "COMMANDS" },
         { null }
     };
 
@@ -224,6 +226,12 @@
         {
             window.setup_command( initial_command );
         }
+        else if ( initial_command_line != null )
+        {
+            initial_command = string.joinv( " ", initial_command_line );
+            window.setup_command( initial_command );
+        }
+
         window.run();
 
         return 0;





More information about the commitlog mailing list