Exemplo n.º 1
0
        public static Task <int> Main(string[] args)
        {
            var parser = new CommandLineBuilder()
                         .AddCommand(CollectCommandHandler.CollectCommand())
                         .AddCommand(ProcessStatusCommandHandler.ProcessStatusCommand("Lists the dotnet processes that traces can be collected"))
                         .AddCommand(ListProfilesCommandHandler.ListProfilesCommand())
                         .AddCommand(ConvertCommandHandler.ConvertCommand())
                         .UseDefaults()
                         .Build();

            return(parser.InvokeAsync(args));
        }
Exemplo n.º 2
0
        public static Task <int> Main(string[] args)
        {
            var parser = new CommandLineBuilder()
#if DEBUG
                         .AddCommand(StopCommandHandler.StopCommand())
#endif
                         .AddCommand(CollectCommandHandler.CollectCommand())
                         .AddCommand(ListProcessesCommandHandler.ListProcessesCommand())
                         .AddCommand(ListProfilesCommandHandler.ListProfilesCommand())
                         .UseDefaults()
                         .Build();

            return(parser.InvokeAsync(args));
        }
Exemplo n.º 3
0
        public static Task <int> Main(string[] args)
        {
            var parser = new CommandLineBuilder()
                         .AddCommand(CollectCommandHandler.CollectCommand())
                         .AddCommand(ProcessStatusCommandHandler.ProcessStatusCommand("Lists the dotnet processes that traces can be collected"))
                         .AddCommand(ListProfilesCommandHandler.ListProfilesCommand())
                         .AddCommand(ConvertCommandHandler.ConvertCommand())
                         .UseDefaults()
                         .Build();
            ParseResult parseResult       = parser.Parse(args);
            string      parsedCommandName = parseResult.CommandResult.Command.Name;

            if (parsedCommandName == "collect")
            {
                IReadOnlyCollection <string> unparsedTokens = parseResult.UnparsedTokens;
                // If we notice there are unparsed tokens, user might want to attach on startup.
                if (unparsedTokens.Count > 0)
                {
                    ProcessLauncher.Launcher.PrepareChildProcess(args);
                }
            }
            return(parser.InvokeAsync(args));
        }