From 5a6a2e056bd4c3f8030c9857240825d22eef1851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jozef=20Steinh=C3=BCbl?= Date: Mon, 29 Jul 2024 22:29:53 +0200 Subject: [PATCH] feat: gimi provider help message --- src/cli/command/provider.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/cli/command/provider.c b/src/cli/command/provider.c index 16925ef..9e26477 100644 --- a/src/cli/command/provider.c +++ b/src/cli/command/provider.c @@ -5,6 +5,14 @@ #include #include +#define HELP \ + "Usage: gimi provider [-h | --help]\n\n" \ + "Commands for working with gimi provider:\n" \ + " info Print info about the provider\n" \ + " sync Synchronize gimi provider with git\n\n" \ + "Options:\n" \ + " -h, --help Show this help message and exit\n" + int providers() { struct gimi_config *cfg = config_read(); ASSERT_CONFIG_EXIST(cfg); @@ -86,6 +94,11 @@ int cli_command_provider(int argc, char **argv) { char *subcommand = argv[0]; + if (strcmp(argv[0], "--help") == 0 || strcmp(argv[0], "-h") == 0) { + printf("%s", HELP); + return 0; + } + if (strcmp(subcommand, "info") == 0) { return provider_info(argc, argv); }