Skip to content

Commit ccfa982

Browse files
committed
*: move --user flags to only the programs that it makes sense
checkpath and other helpers shouldn't really get called with --user
1 parent dbba91d commit ccfa982

7 files changed

Lines changed: 12 additions & 7 deletions

File tree

src/openrc-run/openrc-run.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ const char *extraopts = "stop | start | restart | status | describe | zap";
6969
opt(s, ifstarted, no_argument, "only run commands when started") \
7070
opt(S, ifstopped, no_argument, "only run commands when stopped") \
7171
opt(D, nodeps, no_argument, "ignore dependencies") \
72-
opt(l, lockfd, required_argument, "fd of the exclusive lock from rc")
72+
opt(l, lockfd, required_argument, "fd of the exclusive lock from rc") \
73+
opt(U, user, no_argument, "Run in user mode")
7374
cmdline_opts(opts)
7475

7576
static char *service, *runlevel, *ibsave, *prefix;

src/openrc/rc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@
5454
opt(o, override, required_argument, "override the next runlevel to change into\n" \
5555
"when leaving single user or boot runlevels") \
5656
opt(s, service, required_argument, "runs the service specified with the rest of the arguments") \
57-
opt(S, sys, no_argument, "output the RC system type, if any")
57+
opt(S, sys, no_argument, "output the RC system type, if any") \
58+
opt(U, user, no_argument, "Run in user mode")
5859
cmdline_opts(opts)
5960

6061
const char *extraopts = NULL;

src/rc-depend/rc-depend.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ const char *extraopts = NULL;
3939
opt(T, notrace, no_argument, "Don't trace service dependencies") \
4040
opt(s, strict, no_argument, "Only use what is in the runlevels") \
4141
opt(u, update, no_argument, "Force an update of the dependency tree") \
42-
opt(F, deptree-file, required_argument, "File to load cached deptree from")
42+
opt(F, deptree-file, required_argument, "File to load cached deptree from") \
43+
opt(U, user, no_argument, "Run in user mode")
4344
cmdline_opts(opts)
4445
const char *usagestring = NULL;
4546

src/rc-service/rc-service.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ const char *extraopts = NULL;
4343
opt(S, ifstopped, no_argument, "if the service is stopped run the command") \
4444
opt(l, list, no_argument, "list all available services") \
4545
opt(r, resolve, required_argument, "resolve the service name to an init script") \
46-
opt(Z, dry-run, no_argument, "dry run (show what would happen)")
46+
opt(Z, dry-run, no_argument, "dry run (show what would happen)") \
47+
opt(U, user, no_argument, "Run in user mode")
4748
cmdline_opts(opts)
4849

4950
const char *usagestring = ""

src/rc-status/rc-status.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ const char *extraopts = NULL;
4949
opt(r, runlevel, no_argument, "Show the name of the current runlevel") \
5050
opt(s, servicelist, no_argument, "Show service list") \
5151
opt(S, supervised, no_argument, "show supervised services") \
52-
opt(u, unused, no_argument, "Show services not assigned to any runlevel")
52+
opt(u, unused, no_argument, "Show services not assigned to any runlevel") \
53+
opt(U, user, no_argument, "Run in user mode")
5354
cmdline_opts(opts)
5455
const char *usagestring = ""
5556
"Usage: rc-status [-C] [-f ini] [-i state] [runlevel]\n"

src/rc-update/rc-update.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ const char *usagestring = ""
3939
#define opts(opt, opt_long) \
4040
opt(a, all, no_argument, "Process all runlevels") \
4141
opt(s, stack, no_argument, "Stack a runlevel instead of a service") \
42-
opt(u, update, no_argument, "Force an update of the dependency tree")
42+
opt(u, update, no_argument, "Force an update of the dependency tree") \
43+
opt(U, user, no_argument, "Run in user mode")
4344
cmdline_opts(opts)
4445

4546
/* Return the number of changes made:

src/shared/_usage.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
opt(V, version, no_argument, "Display software version") \
3030
opt(v, verbose, no_argument, "Run verbosely") \
3131
opt(q, quiet, no_argument, "Run quietly (repeat to suppress errors)") \
32-
opt(U, user, no_argument, "Run in user mode")
3332

3433
#define cmdline_opts(opts) \
3534
const struct option longopts[] = { opts(longopt, longopt_only) common_opts(longopt) }; \

0 commit comments

Comments
 (0)