@@ -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
0 commit comments