Browse Source

Display an error message if an unknown flag is encountered.

tags/v0.1
Starbeamrainbowlabs 3 years ago
parent
commit
2470b88a55
1 changed files with 7 additions and 1 deletions
  1. 7
    1
      SpritePacker/Program.cs

+ 7
- 1
SpritePacker/Program.cs View File

@@ -23,7 +23,7 @@ namespace SpritePacker
23 23
 		private static string commitHashFilename = "SpritePacker.latest-commit-hash.txt";
24 24
 		private static List<string> values = new List<string>();
25 25
 
26
-		public static void Main(string[] args)
26
+		public static int Main(string[] args)
27 27
 		{
28 28
 			string commitHash = Utilities.GetEmbeddedResourceContent(commitHashFilename).Trim();
29 29
 			Version += "-" + commitHash.Substring(commitHash.Length - 7);
@@ -39,6 +39,11 @@ namespace SpritePacker
39 39
 						programMode = ProgramMode.DisplayVersionText;
40 40
 						break;
41 41
 					default:
42
+						if(args[i].StartsWith("-"))
43
+						{
44
+							Console.Error.WriteLine("Error: Unrecognised flag '{0}'.", args[i]);
45
+							return 1;
46
+						}
42 47
 						values.Add(args[i]);
43 48
 						break;
44 49
 				}
@@ -66,6 +71,7 @@ namespace SpritePacker
66 71
 					break;
67 72
 			}
68 73
 
74
+			return 0;
69 75
 		}
70 76
 
71 77
 		public static void RunNormal()

Loading…
Cancel
Save