Skip to content

Commit 35ca0b9

Browse files
committed
Added the capacity to use first argument as file path.
Bump version to 1.6.0.0
1 parent 66d1584 commit 35ca0b9

3 files changed

Lines changed: 22 additions & 8 deletions

File tree

DebugXPath/DebugXPath.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@
5454
<None Include="App.config" />
5555
</ItemGroup>
5656
<ItemGroup>
57-
<Content Include="Namespaces.txt">
58-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
59-
</Content>
57+
<Content Include="Namespaces.txt" />
6058
<Content Include="XPath.ico" />
6159
</ItemGroup>
6260
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

DebugXPath/Program.cs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class Program
1919

2020
private static Dictionary<string, string> _namespaces;
2121

22+
private static bool _startWithParameter = false;
2223
private static bool _inSelectionMode = false;
2324
private static bool _enterSelectionMode = false;
2425
private static XmlNode _selectedNode = null;
@@ -43,11 +44,26 @@ static void Main(string[] args)
4344

4445
LoadNamespaces();
4546

47+
if(args.Length > 0)
48+
{
49+
path = args[0];
50+
_startWithParameter = true;
51+
}
52+
4653
CConsole.WriteLine("Enter a path to a xml file (or 'exit' to quit).",ConsoleColor.Green);
4754
while (true)
4855
{
4956
CConsole.Write("File path > ",ConsoleColor.Green);
50-
path = Console.ReadLine();
57+
58+
if (_startWithParameter)
59+
{
60+
Console.WriteLine(path);
61+
_startWithParameter = false;
62+
}
63+
else
64+
{
65+
path = Console.ReadLine();
66+
}
5167

5268
if (path == string.Empty) continue;
5369
if (path.Equals(EXIT_KEYWORD, StringComparison.InvariantCultureIgnoreCase)) break;
@@ -192,8 +208,6 @@ private static void LoadNamespaces()
192208
_namespaces.Add(parts[0], parts[1]);
193209
}
194210
}
195-
196-
Console.WriteLine($"{_namespaces.Count} namespaces loaded.");
197211
}
198212
else
199213
{
@@ -209,6 +223,8 @@ private static void LoadNamespaces()
209223
CConsole.WriteLine("Error when creating namespaces file. Msg: " + ex.Message,ConsoleColor.Red);
210224
}
211225
}
226+
227+
Console.WriteLine($"{_namespaces.Count} namespaces loaded.");
212228
Console.WriteLine();
213229
}
214230

DebugXPath/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
3333
// en utilisant '*', comme indiqué ci-dessous :
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.5.0.0")]
36-
[assembly: AssemblyFileVersion("1.5.0.0")]
35+
[assembly: AssemblyVersion("1.6.0.0")]
36+
[assembly: AssemblyFileVersion("1.6.0.0")]

0 commit comments

Comments
 (0)