summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2016-11-13 16:28:04 +0100
committerFranck Bui <fbui@suse.com>2016-11-17 18:16:50 +0100
commit56fde33af1101bd7d01f1f8b2472d37ab04490c6 (patch)
tree8ea4727350b261d120e63353f1edfabe9e071e70
parentdd6f9ac0d03d073f5dfbf1166f63c6bb64d7ce0c (diff)
core: add 'j' in confirmation_spawn to list the jobs that are in progress
-rw-r--r--NEWS1
-rw-r--r--src/core/execute.c6
2 files changed, 6 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 45d3336b1b..5cb1151b6e 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,7 @@ CHANGES WITH 233 in spe
(f)ail, don't execute the command and pretend it failed
(h)elp
(i)nfo, show a short summary of the unit
+ (j)obs, show jobs that are in progress
(s)kip, don't execute the command and pretend it succeeded
(y)es, execute the command
diff --git a/src/core/execute.c b/src/core/execute.c
index 6c65bdc361..6a7ad66a21 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -740,7 +740,7 @@ static int ask_for_confirmation(const char *vc, Unit *u, const char *cmdline) {
}
for (;;) {
- r = ask_char(&c, "yfshiD", "Execute %s? [y, f, s – h for help] ", e);
+ r = ask_char(&c, "yfshiDj", "Execute %s? [y, f, s – h for help] ", e);
if (r < 0) {
write_confirm_error_fd(r, STDOUT_FILENO);
r = CONFIRM_EXECUTE;
@@ -760,6 +760,7 @@ static int ask_for_confirmation(const char *vc, Unit *u, const char *cmdline) {
" f - fail, don't execute the command and pretend it failed\n"
" h - help\n"
" i - info, show a short summary of the unit\n"
+ " j - jobs, show jobs that are in progress\n"
" s - skip, don't execute the command and pretend it succeeded\n"
" y - yes, execute the command\n");
continue; /* ask again */
@@ -769,6 +770,9 @@ static int ask_for_confirmation(const char *vc, Unit *u, const char *cmdline) {
" Command: %s\n",
u->id, u->description, cmdline);
continue; /* ask again */
+ case 'j':
+ manager_dump_jobs(u->manager, stdout, " ");
+ continue; /* ask again */
case 's':
printf("Skipping execution.\n");
r = CONFIRM_PRETEND_SUCCESS;