]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ac-power: follow-up for recent change
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 31 Mar 2025 10:52:39 +0000 (19:52 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 31 Mar 2025 17:55:28 +0000 (02:55 +0900)
Follow-ups for 72586a971b5ee26b6681fc34ba43c0081dbd94da.

- drop 'Options' sections,
- drop underlining for link,
- fix indentation.

Prompted by https://github.com/systemd/systemd/pull/36850#discussion_r2020594171
> the underline stuff we only use for long --help texts that have sections,
> for the section headers. systemctl --help does that for example. This one
> here is not that long, hence doesn't really need section headers, and
> hence no underlining. The clickable links don't need to be explicitly
> underlined, the terminal emulators that supper hyperlinks will underline
> them on their own (for example gnome-terminal uses a dotted line).

Addresses https://github.com/systemd/systemd/pull/36873#discussion_r2017578611

src/ac-power/ac-power.c

index e184bc443225d70fe410847b468077421588c3d2..abbf65cc29a86d3665d8957285004231d21356a2 100644 (file)
@@ -24,20 +24,18 @@ static int help(void) {
                 return log_oom();
 
         printf("%1$s [OPTION]\n"
-               "\n%2$sReport whether we are connected to an external power source.%4$s\n"
-               "\n%3$sOptions:%4$s\n"
+               "\n%2$sReport whether we are connected to an external power source.%3$s\n\n"
                "  -h --help             Show this help\n"
                "     --version          Show package version\n"
                "  -v --verbose          Show state as text\n"
                "     --low              Check if battery is discharging and low\n"
-               "\nSee the %3$s%5$s%4$s for details.\n",
+               "\nSee the %4$s for details.\n",
                program_invocation_short_name,
                ansi_highlight(),
-               ansi_underline(),
                ansi_normal(),
                link);
 
-               return 0;
+        return 0;
 }
 
 static int parse_argv(int argc, char *argv[]) {