From dcc47b179fed0ae67b0481b2454aea03947e712c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 2 Feb 2010 23:32:03 +0100 Subject: systemctl: minor additions --- systemctl.vala | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/systemctl.vala b/systemctl.vala index f3b2e62e59..abeb0ac7a9 100644 --- a/systemctl.vala +++ b/systemctl.vala @@ -28,6 +28,8 @@ public interface Manager : DBus.Object { public abstract JobInfo[] ListJobs() throws DBus.Error; public abstract ObjectPath LoadUnit(string name) throws DBus.Error; + + public abstract void ClearJobs() throws DBus.Error; } static string type = null; @@ -81,7 +83,7 @@ int main (string[] args) { uint n = 0; Posix.qsort(list, list.length, sizeof(Manager.UnitInfo), unit_info_compare); - stdout.printf("%-45s %-6s %-12s → %-15s\n\n", "UNIT", "LOAD", "ACTIVE", "JOB"); + stdout.printf("%-45s %-6s %-12s %-17s\n", "UNIT", "LOAD", "ACTIVE", "JOB"); foreach (var i in list) { @@ -110,9 +112,17 @@ int main (string[] args) { var list = manager.ListJobs(); Posix.qsort(list, list.length, sizeof(Manager.JobInfo), job_info_compare); + stdout.printf("%-45s %-17s %-7s\n", "UNIT", "TYPE", "STATE"); + foreach (var i in list) stdout.printf("%-45s → %-15s %-7s\n", i.name, i.type, i.state); + stdout.printf("\n%u jobs listed.\n", list.length); + + } else if (args[1] == "clear-jobs") { + + manager.ClearJobs(); + } else if (args[1] == "load") { if (args.length < 3) { -- cgit v1.2.3-54-g00ecf