public FindCommandSourceResult(ParseResult parseResult, FindCommandSource commandSource, int exitCode)
     : base(parseResult, (commandSource.ParentCommandSource as CliRootCommandSource), exitCode)
 {
     intArgArgument_Result     = CommandSourceMemberResult.Create(commandSource.intArgArgument, parseResult);
     stringOptionOption_Result = CommandSourceMemberResult.Create(commandSource.stringOptionOption, parseResult);
     boolOptionOption_Result   = CommandSourceMemberResult.Create(commandSource.boolOptionOption, parseResult);
 }
コード例 #2
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);
     });
 }