diff --git a/AM2RPortHelperCLI/AM2RPortHelperCLI.csproj b/AM2RPortHelperCLI/AM2RPortHelperCLI.csproj index e0e285b..0928098 100644 --- a/AM2RPortHelperCLI/AM2RPortHelperCLI.csproj +++ b/AM2RPortHelperCLI/AM2RPortHelperCLI.csproj @@ -6,7 +6,7 @@ LatestMajor 10 AM2RPortHelper - 1.0.0 + 1.3.0 diff --git a/AM2RPortHelperCLI/Program.cs b/AM2RPortHelperCLI/Program.cs index 2ddb63b..f5254c9 100644 --- a/AM2RPortHelperCLI/Program.cs +++ b/AM2RPortHelperCLI/Program.cs @@ -1,13 +1,15 @@ using System; using System.CommandLine; +using System.CommandLine.Builder; using System.IO; using AM2RPortHelperLib; namespace AM2RPortHelper; + internal static class Program { - //TODO: add "-l" flag. transfer launcher mods to each other. + //TODO: add "-l" flag. port launcher mods to different versions. private static int Main(string[] args) { @@ -21,10 +23,18 @@ internal static class Program var macOption = new Option(new[] { "-m", "--mac" }, "The output file path for the Mac mod. None given equals to no Mac port."); var nameOption = new Option(new[] { "-n", "--name" }, "The name used for the Mac mod. Required for the Mac option, has no effect on anything else."); - RootCommand rootCommand = new RootCommand(); - rootCommand.AddOption(interactiveOption); + RootCommand rootCommand = new RootCommand() + { + interactiveOption, + fileOption, + linuxOption, + androidOption, + macOption, + nameOption + }; rootCommand.SetHandler(RootMethod, interactiveOption, fileOption, linuxOption, androidOption, macOption, nameOption); - + + return rootCommand.Invoke(args); /* @@ -76,7 +86,7 @@ internal static class Program Console.WriteLine("Please provide the full path to the raw mod zip!"); modZipPath = Console.ReadLine(); - if (IsValidInputZip(modZipPath)) + if (!IsValidInputZip(modZipPath)) Console.WriteLine("Path does not exist, or does not point to a zip file!"); else invalidZip = false; @@ -143,7 +153,7 @@ internal static class Program private static bool IsValidInputZip(string path) { - return path == null || (!File.Exists(path) && Path.GetExtension(path).ToLower() != ".zip"); + return path != null && (File.Exists(path) || Path.GetExtension(path).ToLower() == ".zip"); } private static bool IsValidInputZip(FileInfo path) diff --git a/AM2RPortHelperLib/AM2RPortHelperLib.csproj b/AM2RPortHelperLib/AM2RPortHelperLib.csproj index e3b87a2..08de1e4 100644 --- a/AM2RPortHelperLib/AM2RPortHelperLib.csproj +++ b/AM2RPortHelperLib/AM2RPortHelperLib.csproj @@ -4,6 +4,7 @@ netstandard2.0 enable 10 + 1.8.0