Created
May 5, 2016 04:35
-
-
Save geekygravity/08aaab0781d727f89265f66ca4e5ee7a to your computer and use it in GitHub Desktop.
A utility to parse and modify command args. Sits between LPub3d and L3P. This is not affiliated with L3P, LPub3d, or LDraw.org
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace L3P.utility | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
StringBuilder sb = new StringBuilder(); | |
for (int i = 0; i < args.Length; i++) | |
{ | |
// Remove option if it starts with -lgeo | |
string sPattern = "^(?:-lgeo)"; | |
// Construct desired options for process.start | |
if (System.Text.RegularExpressions.Regex.IsMatch(args[i], sPattern)) | |
{ } | |
else { sb.Append(args[i] + " "); } | |
} | |
System.IO.File.AppendAllLines(@"L3P-utility.txt", args); | |
System.IO.File.AppendAllText(@"L3P-utility.txt", sb.ToString() + System.Environment.NewLine); | |
System.Diagnostics.Process L3P = new System.Diagnostics.Process(); | |
L3P.StartInfo.WorkingDirectory = "C:\\LDraw\\LPub3D\\3rdParty\\l3p1.4WinB"; | |
L3P.StartInfo.FileName = "L3p.exe"; | |
L3P.StartInfo.Arguments = sb.ToString(); | |
L3P.Start(); | |
// Press Enter to continue ... | |
// System.Console.ReadLine(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
.