1
1
using System ;
2
2
using System . IO ;
3
3
using System . Linq ;
4
+ using System . Reflection ;
4
5
using XtractQuery . Interfaces ;
5
6
using XtractQuery . Options ;
6
7
using XtractQuery . Parsers ;
@@ -27,19 +28,19 @@ static void Main(string[] args)
27
28
28
29
if ( ! arguments . Operation . Exists )
29
30
{
30
- Console . WriteLine ( "Specify a valid operation" ) ;
31
+ Console . WriteLine ( "No operation mode was given. Specify an operation mode by using the -o argument. " ) ;
31
32
return ;
32
33
}
33
34
34
35
if ( ! arguments . QueryType . Exists )
35
36
{
36
- Console . WriteLine ( "Specify a valid type" ) ;
37
+ Console . WriteLine ( "No query type was given. Specify a query type by using the -t argument. " ) ;
37
38
return ;
38
39
}
39
40
40
41
if ( ! arguments . QueryFile . Exists )
41
42
{
42
- Console . WriteLine ( "Specify a file" ) ;
43
+ Console . WriteLine ( "No file to process was specified. Specify a file by using the -f argument. " ) ;
43
44
return ;
44
45
}
45
46
@@ -49,19 +50,19 @@ static void Main(string[] args)
49
50
50
51
if ( operation != "e" && operation != "c" )
51
52
{
52
- Console . WriteLine ( "Specify a valid operation") ;
53
+ Console . WriteLine ( $ "The operation mode ' { operation } ' is not valid. Use -h to see a list of valid operation modes. ") ;
53
54
return ;
54
55
}
55
56
56
57
if ( type != "xq32" && type != "xseq" )
57
58
{
58
- Console . WriteLine ( "Specifiy a valid type ") ;
59
+ Console . WriteLine ( $ "The query type ' { type } ' is not valid. Use -h to see a list of valid query types. ") ;
59
60
return ;
60
61
}
61
62
62
63
if ( ! File . Exists ( file ) )
63
64
{
64
- Console . WriteLine ( $ "File { file } does not exist ") ;
65
+ Console . WriteLine ( $ "File ' { Path . GetFullPath ( file ) } ' was not found. ") ;
65
66
return ;
66
67
}
67
68
@@ -142,6 +143,10 @@ private static void PrintHelp()
142
143
Console . WriteLine ( " -t, --type\t \t The type of file given" ) ;
143
144
Console . WriteLine ( " Valid types are: xq32, xseq" ) ;
144
145
Console . WriteLine ( " -f, --file\t \t The file to process" ) ;
146
+ Console . WriteLine ( ) ;
147
+ Console . WriteLine ( "Example usage:" ) ;
148
+ Console . WriteLine ( $ "\t Extract a xq32 query to human readable text: { Assembly . GetExecutingAssembly ( ) . Location } -o e -t xq32 -f [file]") ;
149
+ Console . WriteLine ( $ "\t Create a xq32 query from human readable text: { Assembly . GetExecutingAssembly ( ) . Location } -o c -t xq32 -f [file]") ;
145
150
}
146
151
}
147
152
}
0 commit comments