Skip to content

Commit

Permalink
Fixed issue #152.
Browse files Browse the repository at this point in the history
  • Loading branch information
xupefei committed Dec 29, 2015
1 parent 5de1e38 commit 5f3b3b8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions LEProc/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private static void Main(string[] args)

private static void RunWithDefaultProfile(string path)
{
DoRunWithLEProfile(path, new LEProfile(true));
DoRunWithLEProfile(path, 1, new LEProfile(true));
}

private static void RunWithGlobalProfile(string guid, string path)
Expand All @@ -138,7 +138,7 @@ private static void RunWithGlobalProfile(string guid, string path)

var profile = LEConfig.GetProfiles().First(p => p.Guid == guid);

DoRunWithLEProfile(path, profile);
DoRunWithLEProfile(path, 3, profile);
}

private static void RunWithIndependentProfile(string path)
Expand All @@ -154,11 +154,11 @@ private static void RunWithIndependentProfile(string path)
else
{
var profile = LEConfig.GetProfiles(conf)[0];
DoRunWithLEProfile(path, profile);
DoRunWithLEProfile(path, 2, profile);
}
}

private static void DoRunWithLEProfile(string path, LEProfile profile)
private static void DoRunWithLEProfile(string path, int argumentsStart, LEProfile profile)
{
try
{
Expand Down Expand Up @@ -196,7 +196,10 @@ private static void DoRunWithLEProfile(string path, LEProfile profile)
? string.Format("{0} ", path)
: String.Format("\"{0}\" ", path);

commandLine += profile.Parameter;
// use arguments in le.config, prior to command line arguments
commandLine += String.IsNullOrEmpty(profile.Parameter) && Args.Skip(argumentsStart).Any()
? Args.Skip(argumentsStart).Aggregate((a, b) => $"{a} {b}")
: profile.Parameter;
}
else
{
Expand Down

0 comments on commit 5f3b3b8

Please sign in to comment.