]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: add 'D' in confirmat spawn to show a full dump of the unit to spawn
authorFranck Bui <fbui@suse.com>
Sat, 12 Nov 2016 14:08:29 +0000 (15:08 +0100)
committerFranck Bui <fbui@suse.com>
Thu, 17 Nov 2016 17:16:50 +0000 (18:16 +0100)
NEWS
src/core/execute.c

diff --git a/NEWS b/NEWS
index a145c3ab6ed8937ee10c7f1bfb28a5107b527a06..45d3336b1b33f84fda5b238762c74ace2c1a1d1a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ CHANGES WITH 233 in spe
         * The confirmation spawn prompt has been reworked to offer the
           following choices:
 
+           (D)ump, show the state of the unit
            (f)ail, don't execute the command and pretend it failed
            (h)elp
            (i)nfo, show a short summary of the unit
index b48a5732f3cdcc420da5c305ea18505606b74be9..6c65bdc361c2d37b71ad9867db81d666f6089d66 100644 (file)
@@ -740,7 +740,7 @@ static int ask_for_confirmation(const char *vc, Unit *u, const char *cmdline) {
         }
 
         for (;;) {
-                r = ask_char(&c, "yfshi", "Execute %s? [y, f, s – h for help] ", e);
+                r = ask_char(&c, "yfshiD", "Execute %s? [y, f, s – h for help] ", e);
                 if (r < 0) {
                         write_confirm_error_fd(r, STDOUT_FILENO);
                         r = CONFIRM_EXECUTE;
@@ -748,17 +748,21 @@ static int ask_for_confirmation(const char *vc, Unit *u, const char *cmdline) {
                 }
 
                 switch (c) {
+                case 'D':
+                        unit_dump(u, stdout, "  ");
+                        continue; /* ask again */
                 case 'f':
                         printf("Failing execution.\n");
                         r = CONFIRM_PRETEND_FAILURE;
                         break;
                 case 'h':
-                        printf("  f - fail, don't execute the command and pretend it failed\n"
+                        printf("  D - dump, show the state of the unit\n"
+                               "  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"
                                "  s - skip, don't execute the command and pretend it succeeded\n"
                                "  y - yes, execute the command\n");
-                        continue;
+                        continue; /* ask again */
                 case 'i':
                         printf("  Description: %s\n"
                                "  Unit:        %s\n"