private static Command ConfigureCommandLine(Command rootCommand) { // Add subcommands foreach (var subcommand in Subcommands) { rootCommand.AddCommand(subcommand); } // Workload command is behind a feature flag during development if (Env.GetEnvironmentVariableAsBool("DEVENABLEWORKLOADCOMMAND", defaultValue: false)) { rootCommand.AddCommand(WorkloadCommandParser.GetCommand()); } //Add internal commands rootCommand.AddCommand(InstallSuccessCommand); // Add options rootCommand.AddOption(DiagOption); rootCommand.AddOption(VersionOption); rootCommand.AddOption(InfoOption); rootCommand.AddOption(ListSdksOption); rootCommand.AddOption(ListRuntimesOption); // Add argument rootCommand.AddArgument(DotnetSubCommand); return(rootCommand); }
private static Command ConfigureCommandLine(Command rootCommand) { // Add subcommands foreach (var subcommand in Subcommands) { rootCommand.AddCommand(subcommand); } rootCommand.AddCommand(WorkloadCommandParser.GetCommand()); //Add internal commands rootCommand.AddCommand(InstallSuccessCommand); // Add options rootCommand.AddOption(DiagOption); rootCommand.AddOption(VersionOption); rootCommand.AddOption(InfoOption); rootCommand.AddOption(ListSdksOption); rootCommand.AddOption(ListRuntimesOption); // Add argument rootCommand.AddArgument(DotnetSubCommand); return(rootCommand); }
private static bool IsRunningWorkloadCommand(ParseResult parseResult) => parseResult.RootSubCommandResult() == (WorkloadCommandParser.GetCommand().Name);