#include #include "cli.h" #include "compiler.h" #include "internal/cli/options.h" #include "internal/ping/cli_handlers.h" #include "ping/cli.h" /* Forward declarations */ static inline const char * option_arg_type_to_str(int type); /* -------------------- */ int cli_handle_help(__unused const char *arg, __unused void *config_void) { printf("ft_ping - Send ICMP ECHO_REQUEST to network hosts\n"); printf("Usage: ft_ping [options] \n\n"); cli_print_options(g_options, PING_OPT_LEN, option_arg_type_to_str); return CLI_EXIT_SUCCESS; } static inline const char * option_arg_type_to_str(int type) { switch (type) { case OPT_ARG_NONE: return ""; case OPT_ARG_INT: return ""; case OPT_ARG_UINT: return ""; case OPT_ARG_SECONDS: return ""; case OPT_ARG_BYTES: return ""; case OPT_ARG_TTL: return ""; case OPT_ARG_PATTERN: return ""; case OPT_ARG_STRING: return ""; default: return ""; } }