Skip to content

Commit 386ba9c

Browse files
committed
su: update help message
1 parent e4ff66b commit 386ba9c

2 files changed

Lines changed: 17 additions & 12 deletions

File tree

docs/tools.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -281,25 +281,27 @@ Actions:
281281
An applet of `magisk`, the MagiskSU entry point. Good old `su` command.
282282

283283
```
284-
Usage: su [options] [-] [user [argument...]]
284+
Usage: su [options] [--] [user [argument...]]
285285
286286
Options:
287-
-c, --command COMMAND Pass COMMAND to the invoked shell
287+
-s, --shell SHELL Use SHELL instead of the default /system/bin/sh
288+
-i, --interactive Force pseudo-terminal allocation
288289
-g, --group GROUP Specify the primary group
289-
-G, --supp-group GROUP Specify a supplementary group.
290+
-G, --supp-group GROUP Specify a supplementary group
290291
The first specified supplementary group is also used
291-
as a primary group if the option -g is not specified.
292+
as a primary group if the option -g is not specified
292293
-Z, --context CONTEXT Change SELinux context
293294
-t, --target PID PID to take mount namespace from
294-
-h, --help Display this help message and exit
295-
-, -l, --login Pretend the shell to be a login shell
295+
pid 0 means magisk global mount namespacen
296296
-m, -p,
297297
--preserve-environment Preserve the entire environment
298-
-s, --shell SHELL Use SHELL instead of the default /system/bin/sh
299298
-v, --version Display version number and exit
300299
-V Display version code and exit
301-
-mm, -M,
302-
--mount-master Force run in the global mount namespace
300+
-h, --help Display this help message and exit
301+
302+
--: Force stop options parsing, and also stop when an unknown option is found
303+
User: The user to switch to (default root), it can be name or uid
304+
Argument: Pass it to the shell as is
303305
```
304306

305307
### resetprop

native/src/core/su/su.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ int quit_signals[] = { SIGALRM, SIGABRT, SIGHUP, SIGPIPE, SIGQUIT, SIGTERM, SIGI
3636

3737
fprintf(stream,
3838
"MagiskSU\n\n"
39-
"Usage: su [options] [-] [user [argument...]]\n\n"
39+
"Usage: su [options] [--] [user [argument...]]\n\n"
4040
"Options:\n"
4141
" -s, --shell SHELL Use SHELL instead of the default " DEFAULT_SHELL "\n"
4242
" -i, --interactive Force pseudo-terminal allocation\n"
@@ -46,12 +46,15 @@ int quit_signals[] = { SIGALRM, SIGABRT, SIGHUP, SIGPIPE, SIGQUIT, SIGTERM, SIGI
4646
" as a primary group if the option -g is not specified\n"
4747
" -Z, --context CONTEXT Change SELinux context\n"
4848
" -t, --target PID PID to take mount namespace from\n"
49-
" pid 0 means magisk global mount namespace"
49+
" pid 0 means magisk global mount namespacen\n"
5050
" -m, -p,\n"
5151
" --preserve-environment Preserve the entire environment\n"
5252
" -v, --version Display version number and exit\n"
5353
" -V Display version code and exit\n"
54-
" -h, --help Display this help message and exit\n\n");
54+
" -h, --help Display this help message and exit\n\n"
55+
"--: Force stop options parsing, and also stop when an unknown option is found\n"
56+
"User: The user to switch to (default root), it can be name or uid\n"
57+
"Argument: Pass it to the shell as is\n\n");
5558
exit(status);
5659
}
5760

0 commit comments

Comments
 (0)