2020-02-24 16:50:58 +00:00
|
|
|
|
using System;
|
2020-04-06 12:04:40 +00:00
|
|
|
|
using Wabbajack.CLI.Verbs;
|
2020-02-24 16:50:58 +00:00
|
|
|
|
|
|
|
|
|
namespace Wabbajack.CLI
|
|
|
|
|
{
|
2020-04-06 12:04:40 +00:00
|
|
|
|
[AttributeUsage(AttributeTargets.Property)]
|
|
|
|
|
internal class FileAttribute : Attribute { }
|
|
|
|
|
|
|
|
|
|
[AttributeUsage(AttributeTargets.Property)]
|
|
|
|
|
internal class DirectoryAttribute : Attribute { }
|
|
|
|
|
|
2020-02-24 16:50:58 +00:00
|
|
|
|
internal static class CLIUtils
|
|
|
|
|
{
|
2020-04-06 12:04:40 +00:00
|
|
|
|
internal static bool VerifyArguments(AVerb verb)
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-24 16:50:58 +00:00
|
|
|
|
internal static void Log(string msg, bool newLine = true)
|
|
|
|
|
{
|
|
|
|
|
//TODO: maybe also write to a log file?
|
|
|
|
|
if(newLine)
|
|
|
|
|
Console.WriteLine(msg);
|
|
|
|
|
else
|
|
|
|
|
Console.Write(msg);
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-24 17:05:42 +00:00
|
|
|
|
internal static int Exit(string msg, int code)
|
|
|
|
|
{
|
|
|
|
|
Log(msg);
|
|
|
|
|
return code;
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-24 16:50:58 +00:00
|
|
|
|
internal static void LogException(Exception e, string msg)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine($"{msg}\n{e}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|