From: Matheus Afonso Martins Moreira via GitGitGadget Date: Sun, 28 Apr 2024 22:30:56 GMT Subject: [PATCH 08/13] url-parse: define usage and options Message-ID: In-Reply-To: From: Matheus Afonso Martins Moreira Create the data structures expected by the git option parser. Signed-off-by: Matheus Afonso Martins Moreira --- builtin/url-parse.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/builtin/url-parse.c b/builtin/url-parse.c index 15923460a78..c6095b37ede 100644 --- a/builtin/url-parse.c +++ b/builtin/url-parse.c @@ -11,8 +11,22 @@ #include "builtin.h" #include "gettext.h" +#include "parse-options.h" #include "urlmatch.h" +static const char * const builtin_url_parse_usage[] = { + N_("git url-parse [] [--] ..."), + NULL +}; + +static char *component_arg = NULL; + +static struct option builtin_url_parse_options[] = { + OPT_STRING('c', "component", &component_arg, "", \ + N_("which URL component to extract")), + OPT_END(), +}; + enum url_component { URL_NONE = 0, URL_PROTOCOL, -- gitgitgadget