-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
58 lines (46 loc) · 1.24 KB
/
Copy pathProgram.cs
File metadata and controls
58 lines (46 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace PSO2CMXParser
{
class Program
{
public static List<string> Log = new List<string>();
public static List<int> endTagLocations;
public static byte[] fileByteArray;
static int Main(string[] args)
{
return Command(args);
}
public static int Command(string[] args)
{
try
{
if (args.Length < 1)
{
Console.WriteLine("Requires 1 arguments.");
return 0;
}
//main parts
string inFilename = args[0];
CMXparser.ParseCMX(inFilename);
return 0;
} catch(Exception ex)
{
Console.WriteLine(ex.ToString());
return 1;
} finally
{
if(Log.Count > 0)
try
{
var dir = Path.GetDirectoryName(typeof(Program).Assembly.Location);
var logfile = Path.Combine(dir, "lastlog.txt");
File.WriteAllLines(logfile, Log);
} catch {}
}
}
}
}