Exemplo n.º 1
0
        public (bool ok, IParam parsedParam) Parse(string[] args)
        {
            foreach (var arg in args)
            {
                if (arg.Equals("issues"))
                {
                    UrlFragment = IssuesUrl;
                    return(true, this);
                }

                if (arg.StartsWith("issue="))
                {
                    UrlFragment = $"{IssueByIdUrl}/{ParamUtil.SplitAndGetLast(arg, '=')}";
                    return(true, this);
                }

                if (arg.StartsWith("issue/"))
                {
                    UrlFragment = $"{IssueByIdUrl}/{ParamUtil.SplitAndGetLast(arg, '/')}";
                    return(true, this);
                }
            }

            return(false, null);
        }
Exemplo n.º 2
0
        public (bool ok, IParam parsedParam) Parse(string[] args)
        {
            foreach (var arg in args)
            {
                if (arg.Equals("prs") || arg.Equals("pull-requests") || args.Equals("pulls"))
                {
                    UrlFragment = PullRequestsUrl;
                    return(true, this);
                }

                if (arg.StartsWith("pr=") || arg.StartsWith("pull="))
                {
                    UrlFragment = $"{PullRequestByIdUrl}/{ParamUtil.SplitAndGetLast(arg, '=')}";
                    return(true, this);
                }

                if (arg.StartsWith("pr/") || arg.StartsWith("pull/"))
                {
                    UrlFragment = $"{PullRequestByIdUrl}/{ParamUtil.SplitAndGetLast(arg, '/')}";
                    return(true, this);
                }
            }

            return(false, null);
        }