summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-08-31 00:42:27 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-08-31 00:42:27 -0400
commit8e07fc41f86d41e68c5663b2a3c620a0adedcc11 (patch)
tree9b33cc114a2abd83d68b5f942476c574636f0472 /src/core
parent42377d6bb771c31bff931f83163972fdcb224d0c (diff)
Quote unit names in suggested systemctl commandlines
The fact that unit names have to be quoted can be a bit surprising. Show quotes in the hint commandline, but only after checking that this is necessary, since quotes are visually heavy and usually not needed. https://bugs.freedesktop.org/show_bug.cgi?id=82832
Diffstat (limited to 'src/core')
-rw-r--r--src/core/job.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/core/job.c b/src/core/job.c
index 5e4987f4e2..ef5dbce1a3 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -632,11 +632,18 @@ static void job_print_status_message(Unit *u, JobType t, JobResult result) {
unit_status_printf(u, ANSI_GREEN_ON " OK " ANSI_HIGHLIGHT_OFF, format);
break;
- case JOB_FAILED:
+ case JOB_FAILED: {
+ bool quotes;
+
+ quotes = chars_intersect(u->id, SHELL_NEED_QUOTES);
+
manager_flip_auto_status(u->manager, true);
unit_status_printf(u, ANSI_HIGHLIGHT_RED_ON "FAILED" ANSI_HIGHLIGHT_OFF, format);
- manager_status_printf(u->manager, false, NULL, "See 'systemctl status %s' for details.", u->id);
+ manager_status_printf(u->manager, false, NULL,
+ "See \"systemctl status %s%s%s\" for details.",
+ quotes ? "'" : "", u->id, quotes ? "'" : "");
break;
+ }
case JOB_DEPENDENCY:
manager_flip_auto_status(u->manager, true);