@@ -227,6 +227,12 @@ public static ImportSettings Parse(string[] args, string rootFolder, ILogger log
227
227
case "-input" :
228
228
Log . Write ( "input = " + param ) ;
229
229
230
+ if ( string . IsNullOrEmpty ( param . Trim ( ) ) )
231
+ {
232
+ importSettings . errors . Add ( "Input file not defined: " + param ) ;
233
+ break ;
234
+ }
235
+
230
236
// remove quotes (needed for paths with spaces)
231
237
param = param . Trim ( '"' ) ;
232
238
@@ -291,6 +297,14 @@ public static ImportSettings Parse(string[] args, string rootFolder, ILogger log
291
297
case "-output" :
292
298
Log . Write ( "output = " + param ) ;
293
299
300
+ if ( string . IsNullOrEmpty ( param . Trim ( ) ) )
301
+ {
302
+ importSettings . errors . Add ( "Output not defined: " + param ) ;
303
+ break ;
304
+ }
305
+
306
+ param = param . Trim ( '"' ) ;
307
+
294
308
// check if relative or not
295
309
if ( Path . IsPathRooted ( param ) == false )
296
310
{
@@ -663,7 +677,7 @@ public static ImportSettings Parse(string[] args, string rootFolder, ILogger log
663
677
}
664
678
else
665
679
{
666
- importSettings . errors . Add ( "Invalid offset parameter: " + param ) ;
680
+ importSettings . errors . Add ( "Invalid offset parameter (Use: min or legacy) : " + param ) ;
667
681
}
668
682
}
669
683
else // autooffset
@@ -784,7 +798,7 @@ public static ImportSettings Parse(string[] args, string rootFolder, ILogger log
784
798
785
799
if ( param != "legacy" && param != "min" )
786
800
{
787
- importSettings . errors . Add ( "Invalid offsetmode parameter: " + param ) ;
801
+ importSettings . errors . Add ( "Invalid offset parameter: (Use: min or legacy) " + param ) ;
788
802
}
789
803
else
790
804
{
@@ -847,6 +861,9 @@ public static ImportSettings Parse(string[] args, string rootFolder, ILogger log
847
861
Tools . PrintHelpAndExit ( argValueSeparator , waitEnter : true ) ;
848
862
}
849
863
864
+
865
+ // *** VALIDATE SETTINGS ***
866
+
850
867
// check that we had input
851
868
if ( importSettings . inputFiles . Count == 0 || string . IsNullOrEmpty ( importSettings . inputFiles [ 0 ] ) == true )
852
869
{
@@ -916,6 +933,7 @@ public static ImportSettings Parse(string[] args, string rootFolder, ILogger log
916
933
}
917
934
} // have input
918
935
936
+
919
937
// check required settings
920
938
if ( importSettings . exportFormat == ExportFormat . Unknown )
921
939
{
0 commit comments