diff options
author | Aylur <[email protected]> | 2024-12-14 20:14:29 +0100 |
---|---|---|
committer | Aylur <[email protected]> | 2024-12-19 21:31:15 +0100 |
commit | c12fb05408c1cd1b1bca545fec636abda52f6755 (patch) | |
tree | a6556c287718e9e54fb86c901600d15f27bfdf93 /lib/astal/io | |
parent | 4f47b69946dd7127ba66e6333af4945afaba15de (diff) |
style: IO.Process constructor
Diffstat (limited to 'lib/astal/io')
-rw-r--r-- | lib/astal/io/process.vala | 13 | ||||
-rw-r--r-- | lib/astal/io/variable.vala | 2 |
2 files changed, 12 insertions, 3 deletions
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 | @@ -91,13 +91,22 @@ public class AstalIO.Process : Object { } /** + * 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 [[email protected]_parse_argv]. */ 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); } /** diff --git a/lib/astal/io/variable.vala b/lib/astal/io/variable.vala index 312a27a..e4105f8 100644 --- a/lib/astal/io/variable.vala +++ b/lib/astal/io/variable.vala @@ -172,7 +172,7 @@ public class AstalIO.Variable : VariableBase { return_if_fail(watch_proc == null); return_if_fail(watch_exec != null); - watch_proc = new Process.subprocessv(watch_exec); + watch_proc = Process.subprocessv(watch_exec); watch_proc.stdout.connect((str) => set_closure(str, watch_transform)); watch_proc.stderr.connect((str) => this.error(str)); } |