From: Matheus Afonso Martins Moreira <matheus@xxxxxxxxxxxxxxxxxx> Parse all the git URLs given as input on the command line. Die if an URL cannot be parsed. Signed-off-by: Matheus Afonso Martins Moreira <matheus@xxxxxxxxxxxxxxxxxx> --- builtin/url-parse.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/builtin/url-parse.c b/builtin/url-parse.c index 03030035b4f..ab996eadf38 100644 --- a/builtin/url-parse.c +++ b/builtin/url-parse.c @@ -101,10 +101,18 @@ static char *extract(enum url_component component, struct url_info *info) int cmd_url_parse(int argc, const char **argv, const char *prefix) { + struct url_info info; + int i; + argc = parse_options(argc, argv, prefix, builtin_url_parse_options, builtin_url_parse_usage, 0); + for (i = 0; i < argc; ++i) { + parse_or_die(argv[i], &info); + free(info.url); + } + return 0; } -- gitgitgadget