validateEachWith

Helper function to add custom validating delegate.

This function is meant to be used with UFCS, so that it can be placed within option definition chain.

In contrast with validateWith, this functions makes call to delegate for every value.

  1. T validateEachWith(T entry, void delegate(IEntry, string) validator)
    T
    validateEachWith
    (
    T : IEntry
    )
    (
    ,
    void delegate(
    IEntry
    ,
    string
    )
    validator
    )
  2. T validateEachWith(T entry, bool delegate(string) validator, string errorMessage)

Examples

1 new Program("rm")
2     .add(new Argument("target", "target to remove")
3         .validateEachWith((entry, arg) {
4             // do something
5         })
6     )

See Also

DelegateValidator, validateWith

Meta