summaryrefslogtreecommitdiff
path: root/src/systemctl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-02-16 21:59:31 +0100
committerLennart Poettering <lennart@poettering.net>2011-02-16 21:59:31 +0100
commite67c3609b18ab09499b361e18addfcfdec853fdd (patch)
treef7c3a73f95535ce06507cbfbbff5572b7464ef17 /src/systemctl.c
parent30732560c415f52d2a58fc8fab10b602a40c7274 (diff)
systemctl: introduce --ignore-dependencies
Diffstat (limited to 'src/systemctl.c')
-rw-r--r--src/systemctl.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/systemctl.c b/src/systemctl.c
index df4fccc140..4a8b9a196f 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -60,7 +60,7 @@
static const char *arg_type = NULL;
static char **arg_property = NULL;
static bool arg_all = false;
-static bool arg_fail = false;
+static const char *arg_job_mode = "replace";
static bool arg_user = false;
static bool arg_global = false;
static bool arg_immediate = false;
@@ -1384,9 +1384,7 @@ static int start_unit(DBusConnection *bus, char **args, unsigned n) {
mode =
(streq(args[0], "isolate") ||
streq(args[0], "rescue") ||
- streq(args[0], "emergency")) ? "isolate" :
- arg_fail ? "fail" :
- "replace";
+ streq(args[0], "emergency")) ? "isolate" : arg_job_mode;
one_name = table[verb_to_action(args[0])];
@@ -4198,6 +4196,8 @@ static int systemctl_help(void) {
" --full Don't ellipsize unit names on output\n"
" --fail When queueing a new job, fail if conflicting jobs are\n"
" pending\n"
+ " --ignore-dependencies\n"
+ " When queueing a new job, ignore all its dependencies\n"
" -q --quiet Suppress output\n"
" --no-block Do not wait until operation finished\n"
" --no-pager Do not pipe output into a pager.\n"
@@ -4335,6 +4335,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
enum {
ARG_FAIL = 0x100,
+ ARG_IGNORE_DEPENDENCIES,
ARG_VERSION,
ARG_USER,
ARG_SYSTEM,
@@ -4362,6 +4363,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
{ "failed", no_argument, NULL, ARG_FAILED },
{ "full", no_argument, NULL, ARG_FULL },
{ "fail", no_argument, NULL, ARG_FAIL },
+ { "ignore-dependencies", no_argument, NULL, ARG_IGNORE_DEPENDENCIES },
{ "user", no_argument, NULL, ARG_USER },
{ "system", no_argument, NULL, ARG_SYSTEM },
{ "global", no_argument, NULL, ARG_GLOBAL },
@@ -4428,7 +4430,11 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
break;
case ARG_FAIL:
- arg_fail = true;
+ arg_job_mode = "fail";
+ break;
+
+ case ARG_IGNORE_DEPENDENCIES:
+ arg_job_mode = "ignore-dependencies";
break;
case ARG_USER: