]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Highlight the synopsis and summary in --help 13753/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 8 Oct 2019 16:19:59 +0000 (18:19 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 8 Oct 2019 16:21:27 +0000 (18:21 +0200)
This doesn't cover all the binaries, but I don't know how to script
this, and I run out of steam ;)

src/busctl/busctl.c
src/coredump/coredumpctl.c
src/hostname/hostnamectl.c
src/locale/localectl.c
src/login/loginctl.c
src/machine/machinectl.c
src/network/networkctl.c
src/portable/portablectl.c
src/resolve/resolvectl.c
src/systemctl/systemctl.c
src/timedate/timedatectl.c

index e1055ff220b6ab5e7c6ec7ee0f07978f79ba5214..8475c5bfddc5e7bb5e8129aed66ccb3a26337ee0 100644 (file)
@@ -2230,8 +2230,8 @@ static int help(void) {
         if (r < 0)
                 return log_oom();
 
-        printf("%s [OPTIONS...] {COMMAND} ...\n\n"
-               "Introspect the bus.\n\n"
+        printf("%s%s [OPTIONS...] {COMMAND} ...\n\n"
+               "Introspect the bus.%s\n\n"
                "Commands:\n"
                "  list                     List bus names\n"
                "  status [SERVICE]         Show bus service, process or bus owner credentials\n"
@@ -2279,7 +2279,9 @@ static int help(void) {
                "                           system\n"
                "     --destination=SERVICE Destination service of a signal\n"
                "\nSee the %s for details.\n"
+               , ansi_highlight()
                , program_invocation_short_name
+               , ansi_normal()
                , link
         );
 
index 6ce0c297d859573d3f677fc3b17e1089e60cb284..4b972481d947a2f504d1ea7feab8ebbce9eda247 100644 (file)
@@ -146,8 +146,8 @@ static int help(void) {
         if (r < 0)
                 return log_oom();
 
-        printf("%s [OPTIONS...]\n\n"
-               "List or retrieve coredumps from the journal.\n"
+        printf("%s%s [OPTIONS...]\n\n"
+               "List or retrieve coredumps from the journal.%s\n"
                "\nCommands:\n"
                "  list [MATCHES...]  List available coredumps (default)\n"
                "  info [MATCHES...]  Show detailed information about one or more coredumps\n"
@@ -168,7 +168,9 @@ static int help(void) {
                "  -D --directory=DIR     Use journal files from directory\n\n"
                "  -q --quiet             Do not show info messages and privilege warning\n"
                "\nSee the %s for details.\n"
+               , ansi_highlight()
                , program_invocation_short_name
+               , ansi_normal()
                , link
         );
 
index 1dfc0e68e6dc2bf9d56266521f8cd6e1c78b3285..d98812d6dafdd85065fda3499b35c0952856a1cf 100644 (file)
@@ -17,6 +17,7 @@
 #include "main-func.h"
 #include "pretty-print.h"
 #include "spawn-polkit-agent.h"
+#include "terminal-util.h"
 #include "util.h"
 #include "verbs.h"
 
@@ -309,8 +310,8 @@ static int help(void) {
         if (r < 0)
                 return log_oom();
 
-        printf("%s [OPTIONS...] COMMAND ...\n\n"
-               "Query or change system hostname.\n"
+        printf("%s%s [OPTIONS...] COMMAND ...\n\n"
+               "Query or change system hostname.%s\n"
                "\nCommands:\n"
                "  status                 Show current hostname settings\n"
                "  set-hostname NAME      Set system hostname\n"
@@ -328,7 +329,9 @@ static int help(void) {
                "     --static            Only set static hostname\n"
                "     --pretty            Only set pretty hostname\n"
                "\nSee the %s for details.\n"
+               , ansi_highlight()
                , program_invocation_short_name
+               , ansi_normal()
                , link
         );
 
index 9fb51521109ba81fb28f9c780caa9f0c2d6929ae..5532e932551a4ca2a1d82b9308972d3bc9c89c54 100644 (file)
@@ -23,6 +23,7 @@
 #include "set.h"
 #include "spawn-polkit-agent.h"
 #include "strv.h"
+#include "terminal-util.h"
 #include "verbs.h"
 #include "virt.h"
 
@@ -384,8 +385,8 @@ static int help(void) {
         if (r < 0)
                 return log_oom();
 
-        printf("%s [OPTIONS...] COMMAND ...\n\n"
-               "Query or change system locale and keyboard settings.\n\n"
+        printf("%s%s [OPTIONS...] COMMAND ...\n\n"
+               "Query or change system locale and keyboard settings.%s\n\n"
                "  -h --help                Show this help\n"
                "     --version             Show package version\n"
                "     --no-pager            Do not pipe output into a pager\n"
@@ -407,7 +408,9 @@ static int help(void) {
                "                           Show known X11 keyboard mapping variants\n"
                "  list-x11-keymap-options  Show known X11 keyboard mapping options\n"
                "\nSee the %s for details.\n"
+               , ansi_highlight()
                , program_invocation_short_name
+               , ansi_normal()
                , link
         );
 
index 4d11e686362b6e26804082c92a489a7c907a395b..706a4e45fefddbad53a8eaa59b6f76424b0cf79e 100644 (file)
@@ -1280,8 +1280,8 @@ static int help(int argc, char *argv[], void *userdata) {
         if (r < 0)
                 return log_oom();
 
-        printf("%s [OPTIONS...] {COMMAND} ...\n\n"
-               "Send control commands to or query the login manager.\n"
+        printf("%s%s [OPTIONS...] {COMMAND} ...\n\n"
+               "Send control commands to or query the login manager.%s\n"
                "\nSession Commands:\n"
                "  list-sessions            List sessions\n"
                "  session-status [ID...]   Show session status\n"
@@ -1329,7 +1329,9 @@ static int help(int argc, char *argv[], void *userdata) {
                "                             json, json-pretty, json-sse, json-seq, cat,\n"
                "                             with-unit)\n"
                "\nSee the %s for details.\n"
+               , ansi_highlight()
                , program_invocation_short_name
+               , ansi_normal()
                , link
         );
 
index c4fb11122b320326e899c51556b58fb111a7aa62..907f751ef2974b32d2168927ae76ac7ece373c3b 100644 (file)
@@ -2690,9 +2690,9 @@ static int help(int argc, char *argv[], void *userdata) {
         if (r < 0)
                 return log_oom();
 
-        printf("%s [OPTIONS...] {COMMAND} ...\n\n"
+        printf("%s%s [OPTIONS...] {COMMAND} ...\n\n"
                "Send control commands to or query the virtual machine and container\n"
-               "registration manager.\n"
+               "registration manager.%s\n"
                "\nMachine Commands:\n"
                "  list                        List running VMs and containers\n"
                "  status NAME...              Show VM/container details\n"
@@ -2762,7 +2762,9 @@ static int help(int argc, char *argv[], void *userdata) {
                "                              checksum, signature)\n"
                "     --force                  Download image even if already exists\n"
                "\nSee the %s for details.\n"
+               , ansi_highlight()
                , program_invocation_short_name
+               , ansi_normal()
                , link
         );
 
index d624bce1db6b86226554f84d645ec1ec725ef67f..5e8dce0b73c249bad3a10c15f8290eaf68a90ce5 100644 (file)
@@ -1749,8 +1749,8 @@ static int help(void) {
         if (r < 0)
                 return log_oom();
 
-        printf("%s [OPTIONS...]\n\n"
-               "Query and control the networking subsystem.\n"
+        printf("%s%s [OPTIONS...]\n\n"
+               "Query and control the networking subsystem.%s\n"
                "\nCommands:\n"
                "  list [PATTERN...]     List links\n"
                "  status [PATTERN...]   Show link status\n"
@@ -1766,7 +1766,9 @@ static int help(void) {
                "  -a --all              Show status for all links\n"
                "  -s --stats            Show detailed link statics\n"
                "\nSee the %s for details.\n"
+               , ansi_highlight()
                , program_invocation_short_name
+               , ansi_normal()
                , link
         );
 
index 9e160c10f3275dc7a7357d85897ef06cee095cb8..2f8b0254c802f8bc99cf1bf92dd461bb7fc21bae 100644 (file)
@@ -781,8 +781,8 @@ static int help(int argc, char *argv[], void *userdata) {
         if (r < 0)
                 return log_oom();
 
-        printf("%s [OPTIONS...] {COMMAND} ...\n\n"
-               "Attach or detach portable services from the local system.\n"
+        printf("%s%s [OPTIONS...] {COMMAND} ...\n\n"
+               "Attach or detach portable services from the local system.%s\n"
                "Commands:\n"
                "  list                        List available portable service images\n"
                "  attach NAME|PATH [PREFIX...]\n"
@@ -810,7 +810,9 @@ static int help(int argc, char *argv[], void *userdata) {
                "     --cat                    When inspecting include unit and os-release file\n"
                "                              contents\n"
                "\nSee the %s for details.\n"
+               , ansi_highlight()
                , program_invocation_short_name
+               , ansi_normal()
                , link
         );
 
index 59f312d55a1c1ed2f60294056cf92a9ae250234d..ec4bffacba3ebb366543fc1e840f4e7a3bcbb601 100644 (file)
@@ -2523,10 +2523,10 @@ static int native_help(void) {
         if (r < 0)
                 return log_oom();
 
-        printf("%1$s [OPTIONS...] {COMMAND} ...\n"
+        printf("%s%s [OPTIONS...] {COMMAND} ...\n"
                "\n"
                "Send control commands to the network name resolution manager, or\n"
-               "resolve domain names, IPv4 and IPv6 addresses, DNS records, and services.\n"
+               "resolve domain names, IPv4 and IPv6 addresses, DNS records, and services.%s\n"
                "\nCommands:\n"
                "  query HOSTNAME|ADDRESS...    Resolve domain names, IPv4 and IPv6 addresses\n"
                "  service [[NAME] TYPE] DOMAIN Resolve service (SRV)\n"
@@ -2563,8 +2563,10 @@ static int native_help(void) {
                "                                                              (default: yes)\n"
                "     --raw[=payload|packet]    Dump the answer as binary data\n"
                "     --legend=BOOL             Print headers and additional info (default: yes)\n"
-               "\nSee the %2$s for details.\n"
+               "\nSee the %s for details.\n"
+               , ansi_highlight()
                , program_invocation_short_name
+               , ansi_normal()
                , link
         );
 
index a2feb645b3bd6622d318a36382e2c207b51456ef..98a71c446019586e83d7ee60a82f178d1c4544bc 100644 (file)
@@ -7651,8 +7651,8 @@ static int systemctl_help(void) {
         if (r < 0)
                 return log_oom();
 
-        printf("%1$s [OPTIONS...] {COMMAND} ...\n\n"
-               "Query or send control commands to the systemd manager.\n\n"
+        printf("%5$s%1$s [OPTIONS...] {COMMAND} ...\n\n"
+               "Query or send control commands to the systemd manager.%6$s\n\n"
                "%3$sUnit Commands:%4$s\n"
                "  list-units [PATTERN...]             List units currently in memory\n"
                "  list-sockets [PATTERN...]           List socket units currently in memory,\n"
@@ -7802,6 +7802,7 @@ static int systemctl_help(void) {
                , program_invocation_short_name
                , link
                , ansi_underline(), ansi_normal()
+               , ansi_highlight(), ansi_normal()
         );
 
         return 0;
index c5d4d198fe15c980c04831826ff8162297692756..2f9073c3dc5d5ee693ab496e35b19f85e2496b90 100644 (file)
@@ -809,8 +809,8 @@ static int help(void) {
         if (r < 0)
                 return log_oom();
 
-        printf("%s [OPTIONS...] COMMAND ...\n\n"
-               "Query or change system time and date settings.\n"
+        printf("%s%s [OPTIONS...] COMMAND ...\n\n"
+               "Query or change system time and date settings.%s\n"
                "\nCommands:\n"
                "  status                   Show current time settings\n"
                "  show                     Show properties of systemd-timedated\n"
@@ -836,7 +836,9 @@ static int help(void) {
                "  -a --all                 Show all properties, including empty ones\n"
                "     --value               When showing properties, only print the value\n"
                "\nSee the %s for details.\n"
+               , ansi_highlight()
                , program_invocation_short_name
+               , ansi_normal()
                , link
         );