]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cgtop: fix confusion in --help
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 3 Dec 2025 14:23:12 +0000 (15:23 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 27 Feb 2026 20:05:57 +0000 (20:05 +0000)
When we say '-n --iterations=N' in --help, this means that the program
can be invoked with '-n N' or '--iterations=N' or '--iterations N'.
(The short option is specified without the argument.)

Here we tried to use '-p --order=path' to mean that the program can be
invoked with '-p' or '--order=path', but that is incompatible with the
established convention.

Also, indicate that the arg to --cpu is optional.

(cherry picked from commit cb406988ac587a0f2b75948f3fab860005d6bc76)
(cherry picked from commit 8523627f2197ef6d448d97832b946e42cd414fc3)
(cherry picked from commit 7f08d7160bbef89aac3df7f7fe93689965aaec6b)

src/cgtop/cgtop.c

index 08eae5988b0c43b0bb1a65e439e8e714c03dcb69..85e74f77a3562ef2c37312073c5f4cef3860c3dd 100644 (file)
@@ -713,13 +713,18 @@ static int help(void) {
                "Show top control groups by their resource usage.\n\n"
                "  -h --help           Show this help\n"
                "     --version        Show package version\n"
-               "  -p --order=path     Order by path\n"
-               "  -t --order=tasks    Order by number of tasks/processes\n"
-               "  -c --order=cpu      Order by CPU load (default)\n"
-               "  -m --order=memory   Order by memory load\n"
-               "  -i --order=io       Order by IO load\n"
+
+               "     --order=path|tasks|cpu|memory|io\n"
+               "                      Order by specified property\n"
+               "  -p                  Same as --order=path, order by path\n"
+               "  -t                  Same as --order=tasks, order by number of\n"
+               "                      tasks/processes\n"
+               "  -c                  Same as --order=cpu, order by CPU load\n"
+               "  -m                  Same as --order=memory, order by memory load\n"
+               "  -i                  Same as --order=io, order by IO load\n"
                "  -r --raw            Provide raw (not human-readable) numbers\n"
-               "     --cpu=percentage Show CPU usage as percentage (default)\n"
+               "     --cpu[=percentage]\n"
+               "                      Show CPU usage as percentage (default)\n"
                "     --cpu=time       Show CPU usage as time\n"
                "  -P                  Count userspace processes instead of tasks (excl. kernel)\n"
                "  -k                  Count all processes instead of tasks (incl. kernel)\n"