Exemple #1
0
 public static IRule <IParserResult> NotItem <T>(
     this IConstraintsProviderContext <T> cpc,
     string itemPropertyName)
     where T : IConfiguration
 {
     return(new Not <IParserResult>(cpc.ItemIsSet(itemPropertyName)));
 }
Exemple #2
0
 public static IRule <IParserResult> NotArgument <T>(
     this IConstraintsProviderContext <T> cpc,
     string argumentPropertyName)
     where T : IConfiguration
 {
     return(new Not <IParserResult>(cpc.ArgumentIsSet(argumentPropertyName)));
 }
 public void ProvideConstraints(IConstraintsProviderContext <ICli2> cpc)
 {
     cpc.Add(
         new Implies <IParserResult>(
             cpc.ArgumentIsSet(nameof(ICli2.FileArg)),
             new FileExists((FileSystemItemArgument)cpc.GetArgument(nameof(ICli2.FileArg)))));
 }
Exemple #4
0
 public static IRule <IParserResult> ImpliesItemArgument <T>(
     this IConstraintsProviderContext <T> cpc,
     string itemPropertyName,
     string argumentPropertyName)
     where T : IConfiguration
 {
     return(new Implies <IParserResult>(
                cpc.ItemIsSet(itemPropertyName),
                cpc.ArgumentIsSet(argumentPropertyName)));
 }
Exemple #5
0
 public static IRule <IParserResult> ImpliesItemItem <T>(
     this IConstraintsProviderContext <T> cpc,
     string itemPropertyName1,
     string itemPropertyName2)
     where T : IConfiguration
 {
     return(new Implies <IParserResult>(
                cpc.ItemIsSet(itemPropertyName1),
                cpc.ItemIsSet(itemPropertyName2)));
 }
Exemple #6
0
 public void ProvideConstraints(IConstraintsProviderContext <ICli4> cpc)
 {
     cpc.Add(cpc.ArgumentIsSet(nameof(ICli4.Option)));
 }
 public void ProvideConstraints(IConstraintsProviderContext <ICliOr> cpc)
 {
     cpc.Add(cpc.OrItemItem(nameof(ICliOr.Option), nameof(ICliOr.Flag)));
 }
Exemple #8
0
 public void ProvideConstraints(IConstraintsProviderContext <ICliImplies> cpc)
 {
     cpc.Add(cpc.ImpliesItemItem(nameof(ICliImplies.Option), nameof(ICliImplies.Flag)));
 }
 public void ProvideConstraints(IConstraintsProviderContext <ICliAnd> cpc)
 {
     cpc.Add(cpc.AndItemItem(nameof(ICliAnd.Option), nameof(ICliAnd.Flag)));
 }