Beispiel #1
0
        public static Task <int> Main(string[] args)
        {
            var command = new RootCommand()
            {
                Description = "Developer tool to update the Visual Studio project versions."
            };

            command.AddCommand(ListCommand.Create());
            command.AddCommand(MajorCommand.Create());
            command.AddCommand(MinorCommand.Create());
            command.AddCommand(PatchCommand.Create());
            command.AddCommand(BuildCommand.Create());
            command.AddCommand(PreCommand.Create());
            command.AddCommand(SetCommand.Create());


            var builder = new CommandLineBuilder(command)
                          .UseHelp()
                          .UseDefaults()
                          .UseVersionOption()
                          .CancelOnProcessTermination()
                          .UseExceptionHandler();

            var parser = builder.Build();

            return(parser.InvokeAsync(args));
        }
Beispiel #2
0
        public static Task <int> Main(string[] args)
        {
            MSBuildLocator.RegisterDefaults();

            var parser = new CommandLineBuilder()
                         .AddCommand(AddFileCommand.Create())
                         .AddCommand(AddUrlCommand.Create())
                         .AddCommand(RefreshCommand.Create())
                         .AddCommand(RemoveCommand.Create())
                         .AddCommand(ListCommand.Create())
                         .UseDefaults()
                         .Build();

            return(parser.InvokeAsync(args));
        }
Beispiel #3
0
        internal static Parser BuildParser(HttpClient client)
        {
            var root = new RootCommand();

            root.AddCommand(AddFileCommand.Create(client));
            root.AddCommand(AddUrlCommand.Create(client));
            root.AddCommand(RefreshCommand.Create(client));
            root.AddCommand(RemoveCommand.Create(client));
            root.AddCommand(ListCommand.Create(client));

            var parser = new CommandLineBuilder(root)
                         .UseDefaults()
                         .Build();

            return(parser);
        }