mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
14 lines
414 B
C#
14 lines
414 B
C#
using System;
|
|
|
|
namespace CliFx.Extensibility;
|
|
|
|
/// <summary>
|
|
/// Converter for binding command inputs to properties of type <see cref="bool" />.
|
|
/// </summary>
|
|
public class BoolBindingConverter : BindingConverter<bool>
|
|
{
|
|
/// <inheritdoc />
|
|
public override bool Convert(string? rawArgument, IFormatProvider? formatProvider) =>
|
|
string.IsNullOrWhiteSpace(rawArgument) || bool.Parse(rawArgument);
|
|
}
|