From: Zbigniew Jędrzejewski-Szmek Date: Tue, 5 May 2026 08:59:46 +0000 (+0200) Subject: shared/verbs: display default verb as "[verb]" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f94da4b4c564f8cff4b5b739456c985e036a4201;p=thirdparty%2Fsystemd.git shared/verbs: display default verb as "[verb]" --- diff --git a/src/shared/verbs.c b/src/shared/verbs.c index dfecf048612..276c6fd5be9 100644 --- a/src/shared/verbs.c +++ b/src/shared/verbs.c @@ -192,11 +192,15 @@ int _verbs_get_help_table( /* No help string — we do not show the verb */ continue; + bool is_default = FLAGS_SET(verb->flags, VERB_DEFAULT); + /* We indent the option string by two spaces. We could set the minimum cell width and * right-align for a similar result, but that'd be more work. This is only used for * display. */ - r = table_add_cell_stringf(table, NULL, " %s%s%s", + r = table_add_cell_stringf(table, NULL, " %s%s%s%s%s", + is_default ? "[" : "", verb->verb, + is_default ? "]" : "", verb->argspec ? " " : "", strempty(verb->argspec)); if (r < 0)