summaryrefslogtreecommitdiff
path: root/systemctl.vala
diff options
context:
space:
mode:
Diffstat (limited to 'systemctl.vala')
-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) {