]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
prlimit: improve --help output
authorKarel Zak <kzak@redhat.com>
Fri, 1 Oct 2021 12:47:04 +0000 (14:47 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 1 Oct 2021 12:47:04 +0000 (14:47 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/prlimit.c

index eba73c751df4588265cc9ab6766a3086afba25e7..9317ba04425b3118eb200c8b87b3a61c3918a8c8 100644 (file)
@@ -159,14 +159,14 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(USAGE_HEADER, out);
 
        fprintf(out,
-               _(" %s [options] [-p PID]\n"), program_invocation_short_name);
+               _(" %s [options] [--<resource>=<limit>] [-p PID]\n"), program_invocation_short_name);
        fprintf(out,
-               _(" %s [options] COMMAND\n"), program_invocation_short_name);
+               _(" %s [options] [--<resource>=<limit>] COMMAND\n"), program_invocation_short_name);
 
        fputs(USAGE_SEPARATOR, out);
        fputs(_("Show or change the resource limits of a process.\n"), out);
 
-       fputs(_("\nGeneral Options:\n"), out);
+       fputs(USAGE_OPTIONS, out);
        fputs(_(" -p, --pid <pid>        process id\n"
                " -o, --output <list>    define which output columns to use\n"
                "     --noheadings       don't print headings\n"
@@ -175,7 +175,7 @@ static void __attribute__((__noreturn__)) usage(void)
                ), out);
        printf(USAGE_HELP_OPTIONS(24));
 
-       fputs(_("\nResources Options:\n"), out);
+       fputs(_("\nResources:\n"), out);
        fputs(_(" -c, --core             maximum size of core files created\n"
                " -d, --data             maximum size of a process's data segment\n"
                " -e, --nice             maximum nice priority allowed to raise\n"
@@ -194,6 +194,11 @@ static void __attribute__((__noreturn__)) usage(void)
                " -y, --rttime           CPU time in microseconds a process scheduled\n"
                "                        under real-time scheduling\n"), out);
 
+       fputs(USAGE_ARGUMENTS, out);
+       fputs(_(
+               " <limit> is defined as a range soft:hard, soft:, :hard or a value to\n"
+               "         define both limits (e.g. -e=0:10 -r=:10).\n"), out);
+
        fputs(USAGE_COLUMNS, out);
        for (i = 0; i < ARRAY_SIZE(infos); i++)
                fprintf(out, " %11s  %s\n", infos[i].name, _(infos[i].help));