Beispiel #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);
        }
        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);
        }