chiark / gitweb /
systemctl: make -f short for both --follow and --force
authorLennart Poettering <lennart@poettering.net>
Tue, 3 Apr 2012 12:43:48 +0000 (14:43 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 3 Apr 2012 12:43:48 +0000 (14:43 +0200)
TODO
man/systemctl.xml
src/systemctl.c

diff --git a/TODO b/TODO
index 9bff8408a6075938bd16c3b1a2c9d69544fab388..6f7679f235b3ba31a727e0ded22659da45ff661a 100644 (file)
--- a/TODO
+++ b/TODO
@@ -30,8 +30,6 @@ Features:
 
 * dbus upstream still refers to dbus.target and shouldn't
 
-* Make -f in systemctl enable both --follow and --force
-
 * ensure that logind sets the syslog facility to AUTH when logging
 
 * when a service has the same env var set twice we actually store it twice and return that in systemctl show -p... We should only show the last setting
index 968da84e367f978311a2c6a902a6af32b4f06d71..167a72b58b47b5aa40babb27d09b15cddb0f0033 100644 (file)
 
                         <varlistentry>
                                 <term><option>--follow</option></term>
+                                <term><option>-f</option></term>
 
                                 <listitem><para>When used with
                                 <command>status</command> continously
index f51085f8c47aadf1ee4b061d72706ecc3be45f3f..4b27b69c557f4e1dcacde21d8a1e77d0bafcf867 100644 (file)
@@ -4247,7 +4247,8 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
                 ARG_NO_ASK_PASSWORD,
                 ARG_FAILED,
                 ARG_RUNTIME,
-                ARG_FOLLOW
+                ARG_FOLLOW,
+                ARG_FORCE
         };
 
         static const struct option options[] = {
@@ -4271,7 +4272,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
                 { "order",     no_argument,       NULL, ARG_ORDER     },
                 { "require",   no_argument,       NULL, ARG_REQUIRE   },
                 { "root",      required_argument, NULL, ARG_ROOT      },
-                { "force",     no_argument,       NULL, 'f'           },
+                { "force",     no_argument,       NULL, ARG_FORCE     },
                 { "no-reload", no_argument,       NULL, ARG_NO_RELOAD },
                 { "kill-mode", required_argument, NULL, ARG_KILL_MODE }, /* undocumented on purpose */
                 { "kill-who",  required_argument, NULL, ARG_KILL_WHO  },
@@ -4392,8 +4393,18 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
                         arg_quiet = true;
                         break;
 
+                case ARG_FORCE:
+                        arg_force ++;
+                        break;
+
+                case ARG_FOLLOW:
+                        arg_follow = true;
+                        break;
+
                 case 'f':
+                        /* -f is short for both --follow and --force! */
                         arg_force ++;
+                        arg_follow = true;
                         break;
 
                 case ARG_NO_RELOAD:
@@ -4439,10 +4450,6 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
                         }
                         break;
 
-                case ARG_FOLLOW:
-                        arg_follow = true;
-                        break;
-
                 case 'o':
                         arg_output = output_mode_from_string(optarg);
                         if (arg_output < 0) {