public StubOption( OptSpecifier id, string prefix, string name, int argCount = 0) : base(id, prefix, name) { ArgCount = argCount; CreatedArgs = new List <Arg>(); }
protected string[] GetStringList(OptSpecifier opt) { if (!IsOptionSet(opt)) { return(null); } return(((Arg[])activeArgs[opt.Id]).Select(x => x.Value).ToArray()); }
protected ITaskItem GetTaskItem(OptSpecifier opt) { if (!IsOptionSet(opt)) { return(null); } return(new TaskItem(((Arg)activeArgs[opt.Id]).Value)); }
protected ITaskItem[] GetTaskItemList(OptSpecifier opt) { if (!IsOptionSet(opt)) { return(null); } return(((Arg[])activeArgs[opt.Id]).Select(x => new TaskItem(x.Value)).ToArray()); }
protected void SetBool(OptSpecifier pos, bool value) { activeArgs.Remove(pos.Id); if (value) { AddActiveArg(CreateArg(pos)); } }
protected string GetString(OptSpecifier opt) { if (!IsOptionSet(opt)) { return(null); } return(((Arg)activeArgs[opt.Id]).Value); }
protected bool GetBool(OptSpecifier pos, OptSpecifier neg) { if (IsOptionSet(pos)) { return(true); } if (IsOptionSet(neg)) { return(false); } return(false); }
protected override string GenerateCommandLineExceptSources(CommandLineFormat format) { OptSpecifier[] excludeOpts; if (SourcesOption != null) { excludeOpts = new[] { SourcesOption.Value } } ; else { excludeOpts = new OptSpecifier[0]; } return(GenerateCommandLineExcept(excludeOpts, format)); }
private Arg CreateArg(OptSpecifier opt, string value) { var option = optTable.GetOption(opt); return(new Arg(option, option.PrefixedName, 0, value)); }
protected void SetTaskItemList(OptSpecifier opt, ITaskItem[] value) { activeArgs.Remove(opt.Id); AddActiveArg(value?.Select(x => CreateArg(opt, x.ItemSpec)).ToArray()); }
private Arg CreateArg(OptSpecifier pos) { var option = optTable.GetOption(pos); return(new Arg(option, option.PrefixedName, 0)); }
protected void SetTaskItem(OptSpecifier opt, ITaskItem value) { activeArgs.Remove(opt.Id); AddActiveArg(CreateArg(opt, value?.ItemSpec)); }
public FlagOptionInfo(FlagOptionAttribute attribute, OptSpecifier optionId, PropertyInfo property) : base(optionId, property) { this.attribute = attribute; }
protected void SetStringList(OptSpecifier opt, string[] value) { activeArgs.Remove(opt.Id); AddActiveArg(value?.Select(x => CreateArg(opt, x)).ToArray()); }
protected OptionInfo(OptSpecifier optionId, PropertyInfo property) { OptionId = optionId; Property = property; }
protected bool IsOptionSet(OptSpecifier opt) { return(activeArgs.ContainsKey(opt.Id)); }
public TestOption(OptSpecifier id, string name) : base(id, "-", name) { }
private Arg CreateArg(OptSpecifier pos, OptSpecifier neg, bool value) { var option = optTable.GetOption(value ? pos : neg); return(new Arg(option, option.PrefixedName, 0)); }
protected bool GetBool(OptSpecifier pos) { return(IsOptionSet(pos)); }
protected void SetBool(OptSpecifier pos, OptSpecifier neg, bool value) { activeArgs.Remove(pos.Id); activeArgs.Remove(neg.Id); AddActiveArg(CreateArg(pos, neg, value)); }
protected void SetString(OptSpecifier opt, string value) { activeArgs.Remove(opt.Id); AddActiveArg(CreateArg(opt, value)); }
public VerbOption( OptSpecifier id, string name, OptSpecifier?aliasId = null, OptSpecifier?groupId = null, string helpText = null, string metaVar = null) : base(id, name, aliasId, groupId, helpText, metaVar) { }