From: Lennart Poettering Date: Thu, 18 Jun 2026 09:49:45 +0000 (+0200) Subject: sysupdate: port to new help-util.[ch] apis X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7201ca4e12b7c7cee3d7d8600b7b3018571e451e;p=thirdparty%2Fsystemd.git sysupdate: port to new help-util.[ch] apis As usual for stuff we touch, let's modernize the --help texts to our new APIs. --- diff --git a/src/sysupdate/sysupdate.c b/src/sysupdate/sysupdate.c index cadc3e7ccff..a1d292f0eb5 100644 --- a/src/sysupdate/sysupdate.c +++ b/src/sysupdate/sysupdate.c @@ -13,6 +13,7 @@ #include "format-table.h" #include "glyph-util.h" #include "hashmap.h" +#include "help-util.h" #include "hexdecoct.h" #include "image-policy.h" #include "loop-util.h" @@ -1846,14 +1847,9 @@ static int verb_cleanup(int argc, char *argv[], uintptr_t _data, void *userdata) } static int help(void) { - _cleanup_free_ char *link = NULL; _cleanup_(table_unrefp) Table *common_options = NULL, *options = NULL, *verbs = NULL; int r; - r = terminal_urlify_man("systemd-sysupdate", "8", &link); - if (r < 0) - return log_oom(); - r = verbs_get_help_table(&verbs); if (r < 0) return r; @@ -1868,13 +1864,10 @@ static int help(void) { (void) table_sync_column_widths(0, verbs, common_options, options); - printf("%s [OPTIONS...] [VERSION]\n" - "\n%sUpdate OS images.%s\n" - "\n%sCommands:%s\n", - program_invocation_short_name, - ansi_highlight(), ansi_normal(), - ansi_underline(), ansi_normal()); + help_cmdline("[OPTIONS…] [VERSION]"); + help_abstract("Update OS images."); + help_section("Commands"); r = table_print_or_warn(verbs); if (r < 0) return r; @@ -1883,12 +1876,12 @@ static int help(void) { if (r < 0) return r; - printf("\n%sOptions:%s\n", ansi_underline(), ansi_normal()); + help_section("Options"); r = table_print_or_warn(options); if (r < 0) return r; - printf("\nSee the %s for details.\n", link); + help_man_page_reference("systemd-sysupdate", "8"); return 0; }