Message ID | a2acfdbc76c29f59c24c8a8b25076bde121efdf3.1714343461.git.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | builtin: implement, document and test url-parse | expand |
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 [<options>] [--] <url>..."), + NULL +}; + +static char *component_arg = NULL; + +static struct option builtin_url_parse_options[] = { + OPT_STRING('c', "component", &component_arg, "<component>", \ + N_("which URL component to extract")), + OPT_END(), +}; + enum url_component { URL_NONE = 0, URL_PROTOCOL,