]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/help-util: automatically append ":" in sections
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Tue, 5 May 2026 08:40:31 +0000 (10:40 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Tue, 5 May 2026 09:14:33 +0000 (11:14 +0200)
30 files changed:
src/ac-power/ac-power.c
src/notify/notify.c
src/run/run.c
src/shared/help-util.c
src/storage/storage-block.c
src/storage/storage-fs.c
src/storage/storagectl.c
src/systemctl/systemctl.c
src/udev/ata_id/ata_id.c
src/udev/cdrom_id/cdrom_id.c
src/udev/dmi_memory_id/dmi_memory_id.c
src/udev/fido_id/fido_id.c
src/udev/iocost/iocost.c
src/udev/mtd_probe/mtd_probe.c
src/udev/scsi_id/scsi_id.c
src/udev/udev-config.c
src/udev/udevadm-cat.c
src/udev/udevadm-control.c
src/udev/udevadm-hwdb.c
src/udev/udevadm-info.c
src/udev/udevadm-lock.c
src/udev/udevadm-monitor.c
src/udev/udevadm-settle.c
src/udev/udevadm-test-builtin.c
src/udev/udevadm-test.c
src/udev/udevadm-trigger.c
src/udev/udevadm-verify.c
src/udev/udevadm-wait.c
src/udev/udevadm.c
src/udev/v4l_id/v4l_id.c

index 2a9c517329321c92bf588091ff5bd06b179a9469..87242a3b08c7f2970d5999eb4755ce511c102007 100644 (file)
@@ -27,7 +27,7 @@ static int help(void) {
         help_cmdline("[OPTIONS...]");
         help_abstract("Report whether we are connected to an external power source.");
 
-        help_section("Options:");
+        help_section("Options");
         r = table_print_or_warn(options);
         if (r < 0)
                 return r;
index 6c50e4c57c394e17ab676e9211e9012971f193d0..0058eb9d3b961fdb8d94e2a22f59197d44a3cc6a 100644 (file)
@@ -69,7 +69,7 @@ static int help(void) {
         help_cmdline("[OPTIONS...] --fork -- CMDLINE...");
         help_abstract("Notify the service manager about service status updates.");
 
-        help_section("Options:");
+        help_section("Options");
         r = table_print_or_warn(options);
         if (r < 0)
                 return r;
index 46b8014e580c53bcc67b4ef41669f9565411c50c..afae5b2d94af44481842bde20b9d72d676cf5b82 100644 (file)
@@ -166,11 +166,7 @@ static int help(void) {
         help_abstract("Run the specified command in a transient scope or service.");
 
         for (size_t i = 0; i < ELEMENTSOF(groups); i++) {
-                _cleanup_free_ char *title = strjoin(groups[i] ?: "Options", ":");
-                if (!title)
-                        return log_oom();
-
-                help_section(title);
+                help_section(groups[i] ?: "Options");
 
                 r = table_print_or_warn(tables[i]);
                 if (r < 0)
@@ -196,7 +192,7 @@ static int help_sudo_mode(void) {
         help_cmdline("[OPTIONS...] COMMAND [ARGUMENTS...]");
         help_abstract("Elevate privileges interactively.");
 
-        help_section("Options:");
+        help_section("Options");
 
         r = table_print_or_warn(opts_table);
         if (r < 0)
index 7e9d3e70be0c6db26694ad4d18e63dd2036f30ca..7b67bb58f1a21d88267e8fe4ac58411276f9f35a 100644 (file)
@@ -47,7 +47,7 @@ void help_abstract(const char *text) {
 void help_section(const char *title) {
         assert(title);
 
-        printf("\n%s%s%s\n",
+        printf("\n%s%s:%s\n",
                ansi_underline(),
                title,
                ansi_normal());
index e5454a29c28a0d93a8a71e1cd414e04e3fee8378..b33bf9ce40bd3138fe9ce347cbef2a4b0638a672 100644 (file)
@@ -393,7 +393,7 @@ static int help(void) {
         if (r < 0)
                 return r;
 
-        help_section("Options:");
+        help_section("Options");
 
         r = table_print_or_warn(options);
         if (r < 0)
index c01e91a4cefe6832084fca8b830af480f1820df0..167b10dd835426ac0ee18aae3e268cb42c1d0046 100644 (file)
@@ -753,7 +753,7 @@ static int help(void) {
         if (r < 0)
                 return r;
 
-        help_section("Options:");
+        help_section("Options");
 
         r = table_print_or_warn(options);
         if (r < 0)
index 2bc7b7c2a3e40d438aa54fbcf3916a7ab0031dff..f88dff29bc861cdd327a95486d21aa7fbf7c85e0 100644 (file)
@@ -65,13 +65,13 @@ static int help(void) {
 
         (void) table_sync_column_widths(0, verbs, options);
 
-        help_section("Commands:");
+        help_section("Commands");
 
         r = table_print_or_warn(verbs);
         if (r < 0)
                 return r;
 
-        help_section("Options:");
+        help_section("Options");
 
         r = table_print_or_warn(options);
         if (r < 0)
index 4f76c5150021fc926b153c403b39be38fd549053..775188b5191cb101b353aee984f82a4669fd167f 100644 (file)
@@ -113,7 +113,7 @@ static int systemctl_help(void) {
         help_cmdline("[OPTIONS...] COMMAND ...");
         help_abstract("Query or send control commands to the system manager.");
 
-        help_section("Unit Commands:");
+        help_section("Unit Commands");
         printf("  list-units [PATTERN...]             List units currently in memory\n"
                "  list-automounts [PATTERN...]        List automount units currently in memory,\n"
                "                                      ordered by path\n"
@@ -162,7 +162,7 @@ static int systemctl_help(void) {
                "  whoami [PID...]                     Return unit caller or specified PIDs are\n"
                "                                      part of\n");
 
-        help_section("Unit File Commands:");
+        help_section("Unit File Commands");
         printf("  list-unit-files [PATTERN...]        List installed unit files\n"
                "  enable [UNIT...|PATH...]            Enable one or more unit files\n"
                "  disable UNIT...                     Disable one or more unit files\n"
@@ -186,27 +186,27 @@ static int systemctl_help(void) {
                "  get-default                         Get the name of the default target\n"
                "  set-default TARGET                  Set the default target\n");
 
-        help_section("Machine Commands:");
+        help_section("Machine Commands");
         printf("  list-machines [PATTERN...]          List local containers and host\n");
 
-        help_section("Job Commands:");
+        help_section("Job Commands");
         printf("  list-jobs [PATTERN...]              List jobs\n"
                "  cancel [JOB...]                     Cancel all, one, or more jobs\n");
 
-        help_section("Environment Commands:");
+        help_section("Environment Commands");
         printf("  show-environment                    Dump environment\n"
                "  set-environment VARIABLE=VALUE...   Set one or more environment variables\n"
                "  unset-environment VARIABLE...       Unset one or more environment variables\n"
                "  import-environment VARIABLE...      Import all or some environment variables\n");
 
-        help_section("Manager State Commands:");
+        help_section("Manager State Commands");
         printf("  daemon-reload                       Reload systemd manager configuration\n"
                "  daemon-reexec                       Reexecute systemd manager\n"
                "  log-level [LEVEL]                   Get/set logging threshold for manager\n"
                "  log-target [TARGET]                 Get/set logging target for manager\n"
                "  service-watchdogs [BOOL]            Get/set service watchdog state\n");
 
-        help_section("System Commands:");
+        help_section("System Commands");
         printf("  is-system-running                   Check whether system is fully running\n"
                "  default                             Enter system default mode\n"
                "  rescue                              Enter system rescue mode\n"
@@ -226,7 +226,7 @@ static int systemctl_help(void) {
                "  suspend-then-hibernate              Suspend the system, wake after a period of\n"
                "                                      time, and hibernate\n");
 
-        help_section("Options:");
+        help_section("Options");
         printf("  -h --help              Show this help\n"
                "     --version           Show package version\n"
                "     --system            Connect to system manager\n"
index c2fabdcdb844b72eed297b86d268cdfde9157d51..1cde89ad6f602912aa3fbbe90cd742f352997591 100644 (file)
@@ -368,7 +368,7 @@ static int help(void) {
                 return r;
 
         help_cmdline("[OPTIONS...] DEVICE");
-        help_section("Options:");
+        help_section("Options");
 
         return table_print_or_warn(options);
 }
index 27423e985155e5f603996bd1ab8ecf1223662900..40fd7a1e77d8c85006f66532e99ae2c791d0ec59 100644 (file)
@@ -909,7 +909,7 @@ static int help(void) {
                 return r;
 
         help_cmdline("[OPTIONS...] DEVICE");
-        help_section("Options:");
+        help_section("Options");
 
         return table_print_or_warn(options);
 }
index a1708c128c928c53321177c46d6c9cdc758d425d..64af7b802877001b57119f1e95a2908243822f17 100644 (file)
@@ -653,7 +653,7 @@ static int help(void) {
                 return r;
 
         help_cmdline("[OPTIONS...]");
-        help_section("Options:");
+        help_section("Options");
 
         return table_print_or_warn(options);
 }
index a19c7eebec6e711c8a820ab8cbc9d3c5fd117c5d..30bc96c526bdf65f72fddc3539d952e6c4560cb6 100644 (file)
@@ -38,7 +38,7 @@ static int help(void) {
 
         help_cmdline("[OPTIONS...] SYSFS_PATH");
         help_abstract("Identify FIDO security tokens.");
-        help_section("Options:");
+        help_section("Options");
 
         return table_print_or_warn(options);
 }
index eadab1cb8a091cc52cb4adc8f1185ae466a43273..1efd4a5365e1bb8012eb529e720256a60b5aa694 100644 (file)
@@ -68,12 +68,12 @@ static int help(void) {
         help_cmdline("[OPTIONS...] COMMAND");
         help_abstract("Set up iocost model and qos solutions for block devices.");
 
-        help_section("Commands:");
+        help_section("Commands");
         r = table_print_or_warn(verbs);
         if (r < 0)
                 return r;
 
-        help_section("Options:");
+        help_section("Options");
         return table_print_or_warn(options);
 }
 
index fe9924f1b6e28f9a05ac7cad1f659706dad38cce..7280573646d66dd27812fb8bc1a54a782d3732a1 100644 (file)
@@ -45,7 +45,7 @@ static int help(void) {
 
         help_cmdline("[OPTIONS...] /dev/mtd[n]");
         help_abstract("Probe MTD devices.");
-        help_section("Options:");
+        help_section("Options");
 
         return table_print_or_warn(options);
 }
index d7970722848c87a1a2734f39ac1ac393f5f80ff2..295819351d19b4113ed636e118ba7cf38f34729d 100644 (file)
@@ -216,7 +216,7 @@ static int help(void) {
 
         help_cmdline("[OPTION...] DEVICE");
         help_abstract("SCSI device identification.");
-        help_section("Options:");
+        help_section("Options");
 
         return table_print_or_warn(options);
 }
index 541ba16dd906b0bba089bbfa4df3bf7dbbf7add5..27a72f2ac8dcd039b0b87ab632b43f3241006f21 100644 (file)
@@ -160,7 +160,7 @@ static int help(void) {
         help_cmdline("[OPTIONS...]");
         help_abstract("Rule-based manager for device events and files.");
 
-        help_section("Options:");
+        help_section("Options");
 
         r = table_print_or_warn(options);
         if (r < 0)
index 62d30d0234d24eb2a9bd03e6594627fa9b965cab..fcce76663e1a5e701f201f03c2bbb700af57312e 100644 (file)
@@ -28,7 +28,7 @@ static int help(void) {
 
         help_cmdline("cat [OPTIONS...] [FILE...]");
         help_abstract("Show udev rules files.");
-        help_section("Options:");
+        help_section("Options");
         r = table_print_or_warn(options);
         if (r < 0)
                 return r;
index a6ffe83cecaf61a207e8e823f8950111c5b6e37e..0a0bb35fb5dd563ff8f5cbbaf52d578aad3b14cd 100644 (file)
@@ -57,7 +57,7 @@ static int help(void) {
 
         help_cmdline("control OPTION");
         help_abstract("Control the udev daemon.");
-        help_section("Options:");
+        help_section("Options");
         r = table_print_or_warn(options);
         if (r < 0)
                 return r;
index b029db2262a04452e013ec6e0ad6a36f6c071261..bb6f03d5408901e4e5239cf2133fe82224d22ab7 100644 (file)
@@ -25,7 +25,7 @@ static int help(void) {
 
         help_cmdline("hwdb [OPTIONS]");
         help_abstract("Update or query the hardware database.");
-        help_section("Options:");
+        help_section("Options");
         r = table_print_or_warn(options);
         if (r < 0)
                 return r;
index a5cbedc8deedab3f07f204614eaa90902b8c536d..73ed70f4bffb5ad3c0133e4167e6272adee82278 100644 (file)
@@ -811,7 +811,7 @@ static int help(void) {
 
         help_cmdline("info [OPTIONS] [DEVPATH|FILE]");
         help_abstract("Query sysfs or the udev database.");
-        help_section("Options:");
+        help_section("Options");
         r = table_print_or_warn(options);
         if (r < 0)
                 return r;
index c1c3211d34992e061b2de5bfe01942640475f031..fd4b6a9059a4b6306967b479150fc2d612241385 100644 (file)
@@ -45,7 +45,7 @@ static int help(void) {
         help_cmdline("lock [OPTIONS...] COMMAND");
         help_cmdline("lock [OPTIONS...] --print");
         help_abstract("Lock a block device and run a command.");
-        help_section("Options:");
+        help_section("Options");
         r = table_print_or_warn(options);
         if (r < 0)
                 return r;
index c7d1f40fc49b6a884a4e35a21f81ed041201513a..76c9d16d1f96393952396f9fadf9de06503dac4b 100644 (file)
@@ -109,7 +109,7 @@ static int help(void) {
 
         help_cmdline("monitor [OPTIONS]");
         help_abstract("Listen to kernel and udev events.");
-        help_section("Options:");
+        help_section("Options");
         r = table_print_or_warn(options);
         if (r < 0)
                 return r;
index 211a8ff1fbf8c2ac4d3f005c9f5b1eb75ce2bdbf..77882cc074a6c74a294ed4f6e63e25fe6e2da43c 100644 (file)
@@ -39,7 +39,7 @@ static int help(void) {
 
         help_cmdline("settle [OPTIONS]");
         help_abstract("Wait for pending udev events.");
-        help_section("Options:");
+        help_section("Options");
         r = table_print_or_warn(options);
         if (r < 0)
                 return r;
index 9c0082800f37ab4c6f886bd499886c5b8e743bae..3de1366b59f20780e2965ea2c426b31dc022e8c1 100644 (file)
@@ -24,12 +24,12 @@ static int help(void) {
 
         help_cmdline("test-builtin [OPTIONS] COMMAND DEVPATH");
         help_abstract("Test a built-in command.");
-        help_section("Options:");
+        help_section("Options");
         r = table_print_or_warn(options);
         if (r < 0)
                 return r;
 
-        help_section("Commands:");
+        help_section("Commands");
         udev_builtin_list();
         return 0;
 }
index ac368e0f00eecd093b467d37ac645b168236accd..ba8217c8d36b3d11560b73f8aa2aac98ebf57f6f 100644 (file)
@@ -44,7 +44,7 @@ static int help(void) {
 
         help_cmdline("test [OPTIONS] DEVPATH");
         help_abstract("Test an event run.");
-        help_section("Options:");
+        help_section("Options");
         r = table_print_or_warn(options);
         if (r < 0)
                 return r;
index 583d85be0b8d8d989ba9e65033952820464d1c7a..e1fdf323cbc206ee1929d60e95e1aca316afc1e4 100644 (file)
@@ -331,7 +331,7 @@ static int help(void) {
 
         help_cmdline("trigger [OPTIONS] DEVPATH");
         help_abstract("Request events from the kernel.");
-        help_section("Options:");
+        help_section("Options");
         r = table_print_or_warn(options);
         if (r < 0)
                 return r;
index f4388f843adc6a00ef266a41c33fc9615a13714c..e7f803dfb1eacbce42e69d9bb59f0fa5c33a8ea0 100644 (file)
@@ -33,7 +33,7 @@ static int help(void) {
 
         help_cmdline("verify [OPTIONS] [FILE...]");
         help_abstract("Verify udev rules files.");
-        help_section("Options:");
+        help_section("Options");
         r = table_print_or_warn(options);
         if (r < 0)
                 return r;
index 601740144068995bde6cd75311477aaff0d0a3f7..fa12e6c98c17c9e2c0b23d1607ef04fdfa8ee67b 100644 (file)
@@ -307,7 +307,7 @@ static int help(void) {
 
         help_cmdline("wait [OPTIONS] DEVICE [DEVICE…]");
         help_abstract("Wait for devices or device symlinks being created.");
-        help_section("Options:");
+        help_section("Options");
         r = table_print_or_warn(options);
         if (r < 0)
                 return r;
index 47d4335baec7ffc26f7fb6e9308648e78ca81d58..cdc10802749eadfd84225fa63f2cacedfdacedc7 100644 (file)
@@ -30,12 +30,12 @@ static int help(void) {
         help_cmdline("[OPTIONS…] COMMAND [COMMAND OPTIONS…]");
         help_abstract("Send control commands or test the device manager.");
 
-        help_section("Commands:");
+        help_section("Commands");
         r = table_print_or_warn(verbs);
         if (r < 0)
                 return r;
 
-        help_section("Options:");
+        help_section("Options");
         r = table_print_or_warn(options);
         if (r < 0)
                 return r;
index 1a53e1092fb7a3da6e64ab65210ad4b13eefcefe..f1f40324de7f7ca04f9caf0a642279582c2780cd 100644 (file)
@@ -32,7 +32,7 @@ static int help(void) {
 
         help_cmdline("[OPTIONS...] DEVICE");
         help_abstract("Video4Linux device identification.");
-        help_section("Options:");
+        help_section("Options");
 
         return table_print_or_warn(options);
 }