Exemplo n.º 1
0
        public static async Task Main(string[] args)
        {
            IList <string> positionalArgs;
            IDictionary <string, IList <string> > opts;

            try
            {
                (positionalArgs, opts) = CommandLineArgsParser.Parse(args, new (string?, string, bool)[]
 public void CommandIssueCreateParsedAsCreateIssueOptions(params string[] args)
 {
     _sut.Parse(args).Should().Match <CreateIssueOptions>(
         s => s.Title == "test title" &&
         s.Description == "test description" &&
         s.Assignee == "testUser" &&
         s.AssignMyself &&
         s.Labels.SequenceEqual(new[] { "testlabel1", "testlabel2" }) &&
         s.Project == "testProject");
 }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            try
            {
                var arguments = new Arguments();
                CommandLineArgsParser.Parse(args, arguments, autoHelp: true);

                MainImpl(arguments);
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine("Exception raised: {0}", ex.ToString());
            }
        }
Exemplo n.º 4
0
        public async Task <int> Launch(string[] args)
        {
            try
            {
                IVisitableOption visitable = _parser.Parse(args);
                if (visitable == null)
                {
                    return(ExitCode.InvalidArguments);
                }

                await visitable.Accept(_optionsVisitor);
            }
            catch (Exception ex)
            {
                _outputPresenter.ShowError("Unexpected error has occured", ex.ToString());
                return(ExitCode.UnexpectedFailure);
            }
            finally
            {
                WaitForInput();
            }

            return(ExitCode.Success);
        }
 protected override void Act()
 {
     result = parser.Parse(args);
 }
Exemplo n.º 6
0
 protected override void Act()
 {
     exception = Record.Exception(() => parser.Parse(args));
 }