public InvokeCommandSource(RootCommandSource root, CommandSourceBase parent) : base(new Command("invoke", ""), parent) { Command.Handler = CommandHandler.Create(() => { root.CurrentCommandSource = this; return(0); }); }
public ListCommandSource(RootCommandSource root, CommandSourceBase parent) : base(new Command("list", "List the elements you are interested in"), parent) { verbosityOption = Getverbosity(); Command.Add(verbosityOption); Command.Handler = CommandHandler.Create(() => { root.CurrentCommandSource = this; return(0); }); }
public FindCommandSource(RootCommandSource root, CommandSourceBase parent) : base(new Command("find", "Use this to find things"), parent) { intArgArgument = GetintArg(); Command.Add(intArgArgument); stringOptionOption = GetstringOption(); Command.Add(stringOptionOption); boolOptionOption = GetboolOption(); Command.Add(boolOptionOption); Command.Handler = CommandHandler.Create(() => { root.CurrentCommandSource = this; return(0); }); }
public ListCommandCommandSource(RootCommandSource root, NewCommandCommandSource parent) : base(new Command("list", "Lists templates containing the specified template name.If no name is specified, lists all templates."), parent) { ColumnsOption = GetColumnsOption(); Command.Add(ColumnsOption); TypeOption = GetTemplateTypeOption(); Command.Add(TypeOption); LanguageOption = GetLanguageOption(); Command.Add(LanguageOption); Command.Handler = CommandHandler.Create((InvocationContext context) => { root.CurrentCommandSource = this; var result = new ListCommandCommandSourceResult(context.ParseResult, this, 0); result.Run(); return(0); }); }
public CliRootCommandSource(RootCommandSource root, CommandSourceBase parent) : base(new Command("cli-root", "This is the entry point, the end user types the executable name"), parent) { StringPropertyOption = GetStringProperty(); Command.Add(StringPropertyOption); ctorParamOption = GetctorParam(); Command.Add(ctorParamOption); FindCommand = new FindCommandSource(this, this); Command.AddCommand(FindCommand.Command); ListCommand = new ListCommandSource(this, this); Command.AddCommand(ListCommand.Command); Command.Handler = CommandHandler.Create((InvocationContext context) => { CurrentCommandSource = this; CurrentParseResult = context.ParseResult; return(0); }); }
public NewCommandCommandSource(RootCommandSource root, DotnetCommandCommandSource parent) : base(new Command("new", "Run or manage templates"), parent) { ListCommand = new ListCommandCommandSource(root, this); Command.AddCommand(ListCommand.Command); NameOption = GetNameOption(); Command.Add(NameOption); OutputOption = GetOutputOption(); Command.Add(OutputOption); Command.Handler = CommandHandler.Create((InvocationContext context) => { root.CurrentCommandSource = this; var result = new NewCommandCommandSourceResult(context.ParseResult, this, 0); result.Run(); return(0); }); }
public FormatCommandSource(RootCommandSource root, CommandSourceBase parent) : base(new Command("format", "Formats source code."), parent) { folderOption = Getfolder(); Command.Add(folderOption); filesOption = Getfiles(); Command.Add(filesOption); excludeOption = Getexclude(); Command.Add(excludeOption); checkOption = Getcheck(); Command.Add(checkOption); reportOption = Getreport(); Command.Add(reportOption); verbosityOption = Getverbosity(); Command.Add(verbosityOption); Command.Handler = CommandHandler.Create((InvocationContext context) => { CurrentCommandSource = this; CurrentParseResult = context.ParseResult; return(0); }); }
public DotnetFormatCommandSource(RootCommandSource root, CommandSourceBase parent) : base(new Command("dotnet-format", ""), parent) { FolderOption = GetFolder(); Command.Add(FolderOption); FilesOption = GetFiles(); Command.Add(FilesOption); ExcludeOption = GetExclude(); Command.Add(ExcludeOption); CheckOption = GetCheck(); Command.Add(CheckOption); ReportOption = GetReport(); Command.Add(ReportOption); VerbosityOption = GetVerbosity(); Command.Add(VerbosityOption); InvokeCommand = new InvokeCommandSource(this, this); Command.AddCommand(InvokeCommand.Command); Command.Handler = CommandHandler.Create((InvocationContext context) => { CurrentCommandSource = this; CurrentParseResult = context.ParseResult; return(0); }); }