summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-02-02 23:32:03 +0100
committerLennart Poettering <lennart@poettering.net>2010-02-02 23:32:03 +0100
commitdcc47b179fed0ae67b0481b2454aea03947e712c (patch)
treed576db68db67e82f817f707c8d7eab6bbb9eb244
parent5630af71d72a2fa8142886ca2fb37e69a1906bca (diff)
systemctl: minor additions
-rw-r--r--systemctl.vala12
1 files changed, 11 insertions, 1 deletions
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) {