From c12fb05408c1cd1b1bca545fec636abda52f6755 Mon Sep 17 00:00:00 2001 From: Aylur Date: Sat, 14 Dec 2024 20:14:29 +0100 Subject: style: IO.Process constructor --- lib/astal/io/process.vala | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib/astal/io/process.vala') diff --git a/lib/astal/io/process.vala b/lib/astal/io/process.vala index cfd05b9..4b77aee 100644 --- a/lib/astal/io/process.vala +++ b/lib/astal/io/process.vala @@ -76,7 +76,7 @@ public class AstalIO.Process : Object { * * The first element of the vector is executed with the remaining elements as the argument list. */ - public Process.subprocessv(string[] cmd) throws Error { + public Process(string[] cmd) throws Error { Object(argv: cmd); process = new Subprocess.newv(cmd, SubprocessFlags.STDIN_PIPE | @@ -90,6 +90,15 @@ public class AstalIO.Process : Object { read_stream(err_stream, false); } + /** + * Start a new subprocess with the given command. + * + * The first element of the vector is executed with the remaining elements as the argument list. + */ + public static Process subprocessv(string[] cmd) throws Error { + return new Process(cmd); + } + /** * Start a new subprocess with the given command * which is parsed using [func@GLib.shell_parse_argv]. @@ -97,7 +106,7 @@ public class AstalIO.Process : Object { public static Process subprocess(string cmd) throws Error { string[] argv; Shell.parse_argv(cmd, out argv); - return new Process.subprocessv(argv); + return Process.subprocessv(argv); } /** -- cgit v1.2.3