Skip to content
This repository
Browse code

Rough implementation of rungather (ie qx and qqx).

  • Loading branch information...
commit 50e27f480f24e4326ec0052c20e6d481c269c11f 1 parent 15bcd26
colomon authored February 26, 2012
9  lib/Builtins.cs
@@ -1735,6 +1735,15 @@ public partial class Builtins {
1735 1735
 */        return result ? 1 : 0;
1736 1736
     }
1737 1737
 
  1738
+    public static string command_qx(string command_line) {
  1739
+        Type Process = Type.GetType("GLib.Process,glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f");
  1740
+        MethodInfo spawn_sync = Process.GetMethod("SpawnCommandLineSync");
  1741
+
  1742
+        object[] arguments = new object[]{ command_line, null, null, null };
  1743
+        bool result = (bool) spawn_sync.Invoke(null, arguments);
  1744
+        return result ? (string) arguments[1] : "";
  1745
+    }
  1746
+
1738 1747
     public static int path_chmod(string path, double mode) {
1739 1748
         return PosixWrapper.chmod(path, (int) mode);
1740 1749
     }
2  lib/CORE.setting
@@ -3236,7 +3236,7 @@ sub eval($str,:$lang="perl6") is return-pass {
3236 3236
     }
3237 3237
 }
3238 3238
 
3239  
-sub rungather($ ) { die "Run NYI" }
  3239
+sub rungather($command_line) { Q:CgOp { (box Str (command_qx (obj_getstr {$command_line}))) } }
3240 3240
 
3241 3241
 # a rather strange grammar.  All of its rules are tokens, and some of them
3242 3242
 # will die().

0 notes on commit 50e27f4

Please sign in to comment.
Something went wrong with that request. Please try again.