#include "format-table.h"
#include "format-util.h"
#include "fs-util.h"
+#include "help-util.h"
#include "hexdecoct.h"
#include "imds-tool.h"
#include "imds-tool-metrics.h"
#include "options.h"
#include "parse-argument.h"
#include "pcrextend-util.h"
-#include "pretty-print.h"
#include "string-util.h"
#include "strv.h"
#include "time-util.h"
STATIC_DESTRUCTOR_REGISTER(arg_key, freep);
static int help(void) {
- _cleanup_free_ char *link = NULL;
_cleanup_(table_unrefp) Table *options = NULL;
int r;
- r = terminal_urlify_man("systemd-imds", "1", &link);
- if (r < 0)
- return log_oom();
-
r = option_parser_get_help_table(&options);
if (r < 0)
return r;
- printf("%s [OPTIONS...] [KEY]\n"
- "\n%sIMDS data acquisition.%s\n\n",
- program_invocation_short_name,
- ansi_highlight(),
- ansi_normal());
+ help_cmdline("[OPTIONS...] [KEY]");
+ help_abstract("IMDS data acquisition.");
+ 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-imds", "1");
return 0;
}
#include "event-util.h"
#include "exit-status.h"
#include "fd-util.h"
+#include "fileio.h"
#include "format-ifname.h"
#include "format-table.h"
#include "hash-funcs.h"
#include "hashmap.h"
+#include "help-util.h"
#include "imds-util.h"
#include "in-addr-util.h"
#include "io-util.h"
#include "parse-argument.h"
#include "parse-util.h"
#include "path-util.h"
-#include "pretty-print.h"
#include "proc-cmdline.h"
#include "socket-util.h"
#include "string-util.h"
}
static int help(void) {
- _cleanup_free_ char *link = NULL;
_cleanup_(table_unrefp) Table *options = NULL, *endpoint_options = NULL;
int r;
- r = terminal_urlify_man("systemd-imdsd@.service", "8", &link);
- if (r < 0)
- return log_oom();
-
r = option_parser_get_help_table(&options);
if (r < 0)
return r;
(void) table_sync_column_widths(0, options, endpoint_options);
- printf("%1$s [OPTIONS...] KEY\n"
- "\n%2$sLow-level IMDS data acquisition.%3$s\n"
- "\n%4$sOptions:%5$s\n",
- program_invocation_short_name,
- ansi_highlight(),
- ansi_normal(),
- ansi_underline(),
- ansi_normal());
+ help_cmdline("[OPTIONS...] KEY");
+ help_abstract("Low-level IMDS data acquisition.");
+ help_section("Options");
r = table_print_or_warn(options);
if (r < 0)
return r;
- printf("\n%sManual Endpoint Configuration:%s\n",
- ansi_underline(),
- ansi_normal());
-
+ help_section("Manual Endpoint Configuration");
r = table_print_or_warn(endpoint_options);
if (r < 0)
return r;
- printf("\nSee the %s for details.\n", link);
+ help_man_page_reference("systemd-imdsd@.service", "8");
return 0;
}