]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
unshare: in usage text, reshuffle options into somewhat related groups
authorBenno Schulenberg <bensberg@telfort.nl>
Sat, 15 Feb 2025 16:18:43 +0000 (17:18 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 18 Feb 2025 10:07:09 +0000 (11:07 +0100)
First the mount-related options (because --mount was the first
namespace option earlier) plus two other options about folders;
then the options about UIDS and GIDS; then two options about
forking; then two miscellaneous options; and lastly the two
options about time, as --time was the last namespace option.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
sys-utils/unshare.c

index b6c2f8b4573495db9ce6bd0721a1aedb4b828d20..9ec6ef7cce15096ad3296314e11ded390404dddd 100644 (file)
@@ -781,7 +781,16 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(_(" -C, --cgroup[=<file>]     unshare cgroup namespace\n"), out);
        fputs(_(" -T, --time[=<file>]       unshare time namespace\n"), out);
        fputs(USAGE_SEPARATOR, out);
-       fputs(_(" -f, --fork                fork before launching <program>\n"), out);
+       fputs(_(" --mount-proc[=<dir>]      mount proc filesystem first (implies --mount)\n"), out);
+       fputs(_(" --mount-binfmt[=<dir>]    mount binfmt filesystem first (implies --user and --mount)\n"), out);
+       fputs(_(" -l, --load-interp <file>  load binfmt definition in the namespace (implies --mount-binfmt)\n"), out);
+       fputs(_(" --propagation slave|shared|private|unchanged\n"
+               "                           modify mount propagation in mount namespace\n"), out);
+       fputs(_(" -R, --root <dir>          run the command with root directory set to <dir>\n"), out);
+       fputs(_(" -w, --wd <dir>            change working directory to <dir>\n"), out);
+       fputs(USAGE_SEPARATOR, out);
+       fputs(_(" -S, --setuid <uid>        set uid in entered namespace\n"), out);
+       fputs(_(" -G, --setgid <gid>        set gid in entered namespace\n"), out);
        fputs(_(" --map-user <uid>|<name>   map current user to uid (implies --user)\n"), out);
        fputs(_(" --map-group <gid>|<name>  map current group to gid (implies --user)\n"), out);
        fputs(_(" -r, --map-root-user       map current user to root (implies --user)\n"), out);
@@ -792,22 +801,15 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(_(" --map-groups <innergid>:<outergid>:<count>\n"
                "                           map count groups from outergid to innergid (implies --user)\n"), out);
        fputs(USAGE_SEPARATOR, out);
+       fputs(_(" -f, --fork                fork before launching <program>\n"), out);
        fputs(_(" --kill-child[=<signame>]  when dying, kill the forked child (implies --fork)\n"
                "                             defaults to SIGKILL\n"), out);
-       fputs(_(" --mount-proc[=<dir>]      mount proc filesystem first (implies --mount)\n"), out);
-       fputs(_(" --mount-binfmt[=<dir>]    mount binfmt filesystem first (implies --user and --mount)\n"), out);
-       fputs(_(" --propagation slave|shared|private|unchanged\n"
-               "                           modify mount propagation in mount namespace\n"), out);
+       fputs(USAGE_SEPARATOR, out);
        fputs(_(" --setgroups allow|deny    control the setgroups syscall in user namespaces\n"), out);
        fputs(_(" --keep-caps               retain capabilities granted in user namespaces\n"), out);
        fputs(USAGE_SEPARATOR, out);
-       fputs(_(" -R, --root <dir>          run the command with root directory set to <dir>\n"), out);
-       fputs(_(" -w, --wd <dir>            change working directory to <dir>\n"), out);
-       fputs(_(" -S, --setuid <uid>        set uid in entered namespace\n"), out);
-       fputs(_(" -G, --setgid <gid>        set gid in entered namespace\n"), out);
        fputs(_(" --monotonic <offset>      set clock monotonic offset (seconds) in time namespaces\n"), out);
        fputs(_(" --boottime <offset>       set clock boottime offset (seconds) in time namespaces\n"), out);
-       fputs(_(" -l, --load-interp <file>  load binfmt definition in the namespace (implies --mount-binfmt)\n"), out);
 
        fputs(USAGE_SEPARATOR, out);
        fprintf(out, USAGE_HELP_OPTIONS(27));