mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Implemented new attributes in all verbs
This commit is contained in:
parent
f5082d97e6
commit
0bb8d9e84c
@ -6,6 +6,9 @@ namespace Wabbajack.CLI.Verbs
|
||||
{
|
||||
public int Execute()
|
||||
{
|
||||
if (!CLIUtils.HasValidArguments(this))
|
||||
CLIUtils.Exit("The provided arguments are not valid! Check previous messages for more information", -1);
|
||||
|
||||
return Run().Result;
|
||||
}
|
||||
|
||||
|
@ -60,9 +60,6 @@ namespace Wabbajack.CLI.Verbs
|
||||
|
||||
protected override async Task<int> Run()
|
||||
{
|
||||
if (!CLIUtils.HasValidArguments(this))
|
||||
CLIUtils.Exit("Arguments are not valid!", -1);
|
||||
|
||||
if (Modlist != null && (!Modlist.EndsWith(Consts.ModListExtension) && !Modlist.EndsWith("modlist.txt")))
|
||||
return CLIUtils.Exit($"The file {Modlist} is not a valid modlist file!", -1);
|
||||
|
||||
|
@ -11,6 +11,7 @@ namespace Wabbajack.CLI.Verbs
|
||||
[Option('n', "name", Required = true, HelpText = @"Credential to encrypt and store in AppData\Local\Wabbajack")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
[IsFile(CustomMessage = "The input file %1 does not exist!")]
|
||||
[Option('i', "input", Required = true, HelpText = @"Source data file name")]
|
||||
public string? Input { get; set; }
|
||||
|
||||
|
@ -11,6 +11,7 @@ namespace Wabbajack.CLI.Verbs
|
||||
[Verb("validate", HelpText = @"Validates a Modlist")]
|
||||
public class Validate : AVerb
|
||||
{
|
||||
[IsFile(CustomMessage = "The modlist file %1 does not exist!")]
|
||||
[Option('i', "input", Required = true, HelpText = @"Modlist file")]
|
||||
public string? Input { get; set; }
|
||||
|
||||
@ -26,10 +27,6 @@ namespace Wabbajack.CLI.Verbs
|
||||
/// </returns>
|
||||
protected override async Task<int> Run()
|
||||
{
|
||||
if (!File.Exists(Input))
|
||||
return CLIUtils.Exit($"The file {Input} does not exist!", -1);
|
||||
|
||||
|
||||
if (Input != null && !Input.EndsWith(Consts.ModListExtension))
|
||||
return CLIUtils.Exit($"The file {Input} does not end with {Consts.ModListExtension}!", -1);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user