-
-
Notifications
You must be signed in to change notification settings - Fork 254
/
IOptionValidator.cs
21 lines (19 loc) · 881 Bytes
/
IOptionValidator.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.DataAnnotations;
namespace McMaster.Extensions.CommandLineUtils.Validation
{
/// <summary>
/// Provides validation for a <see cref="CommandOption"/>.
/// </summary>
public interface IOptionValidator
{
/// <summary>
/// Validates the values specified for <see cref="CommandOption.Values"/>.
/// </summary>
/// <param name="option">The option.</param>
/// <param name="context">The validation context.</param>
/// <returns>The validation result. Returns <see cref="ValidationResult.Success"/> if the values pass validation.</returns>
ValidationResult? GetValidationResult(CommandOption option, ValidationContext context);
}
}