/// <summary>
/// Apply/store this command line parser option.
/// </summary>
/// <returns></returns>
public CommandLineParser Apply()
{
if (!_Short.HasValue && LongOption == null)
{
throw new ArgumentException("Either a short or long option must be defined!");
}
if (Action == null)
{
throw new ArgumentException("An action has to be defined for this option!");
}
if (_Short.HasValue)
{
CommandLineParser.AddOption(_Short.Value, Action);
}
if (LongOption != null)
{
CommandLineParser.AddOption(LongOption, Action);
}
return(CommandLineParser);
}