Пример #1
0
 public override ValidationResult Validate()
 {
     if (!IsSettingsValid() && !AllowInteractive)
     {
         return(ValidationResult.Error("Not all required settings provided and unex is not running interactively!"));
     }
     else if (AllowInteractive)
     {
         //prompt here
         return(ValidationResult.Error("Interactive execution not currently implemented. Sorry about that!"));
     }
     else if (IsSettingsValid())
     {
         _config.ApiKey = ApiKey.IsSet ? ApiKey.Value : _config.ApiKey;
         _config.FileDescription ??= string.Empty;
         _config.FileName = FileName.IsSet ? FileName.Value : _config.FileName;
         _config.ModId    = ModId == default(int) ? _config.ModId : ModId;
     }
     return(base.Validate());
 }
 /// <summary>
 /// Validates the specified settings and remaining arguments.
 /// </summary>
 /// <param name="context">The command context.</param>
 /// <param name="settings">The settings.</param>
 /// <returns>The validation result.</returns>
 public virtual ValidationResult Validate(CommandContext context, TSettings settings)
 {
     return(ValidationResult.Success());
 }