1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-20 14:03:39 +03:00

core: add 'j' in confirmation_spawn to list the jobs that are in progress

This commit is contained in:
Franck Bui 2016-11-13 16:28:04 +01:00
parent dd6f9ac0d0
commit 56fde33af1
2 changed files with 6 additions and 1 deletions

1
NEWS
View File

@ -9,6 +9,7 @@ CHANGES WITH 233 in spe
(f)ail, don't execute the command and pretend it failed (f)ail, don't execute the command and pretend it failed
(h)elp (h)elp
(i)nfo, show a short summary of the unit (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 (s)kip, don't execute the command and pretend it succeeded
(y)es, execute the command (y)es, execute the command

View File

@ -740,7 +740,7 @@ static int ask_for_confirmation(const char *vc, Unit *u, const char *cmdline) {
} }
for (;;) { 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) { if (r < 0) {
write_confirm_error_fd(r, STDOUT_FILENO); write_confirm_error_fd(r, STDOUT_FILENO);
r = CONFIRM_EXECUTE; 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" " f - fail, don't execute the command and pretend it failed\n"
" h - help\n" " h - help\n"
" i - info, show a short summary of the unit\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" " s - skip, don't execute the command and pretend it succeeded\n"
" y - yes, execute the command\n"); " y - yes, execute the command\n");
continue; /* ask again */ continue; /* ask again */
@ -769,6 +770,9 @@ static int ask_for_confirmation(const char *vc, Unit *u, const char *cmdline) {
" Command: %s\n", " Command: %s\n",
u->id, u->description, cmdline); u->id, u->description, cmdline);
continue; /* ask again */ continue; /* ask again */
case 'j':
manager_dump_jobs(u->manager, stdout, " ");
continue; /* ask again */
case 's': case 's':
printf("Skipping execution.\n"); printf("Skipping execution.\n");
r = CONFIRM_PRETEND_SUCCESS; r = CONFIRM_PRETEND_SUCCESS;