|
@@ -1,6 +1,7 @@
|
1
|
1
|
#include "options.hpp"
|
2
|
2
|
|
3
|
3
|
Options::Options( int argc, char** argv ) {
|
|
4
|
+ validArguments.push_back( Argument( "nodecorations", 'n', true ) );
|
4
|
5
|
validArguments.push_back( Argument( "bordersize", 'b', false ) );
|
5
|
6
|
validArguments.push_back( Argument( "padding", 'p', false ) );
|
6
|
7
|
validArguments.push_back( Argument( "color", 'c', false ) );
|
|
@@ -8,14 +9,21 @@ Options::Options( int argc, char** argv ) {
|
8
|
9
|
validArguments.push_back( Argument( "highlight", 'l', true ) );
|
9
|
10
|
validArguments.push_back( Argument( "format", 'f', false ) );
|
10
|
11
|
validArguments.push_back( Argument( "tolerance", 't', false ) );
|
11
|
|
- validArguments.push_back( Argument( "nodecorations", 'n', false ) );
|
12
|
12
|
validArguments.push_back( Argument( "nokeyboard", 'k', true ) );
|
13
|
13
|
validArguments.push_back( Argument( "noopengl", 'o', true ) );
|
14
|
14
|
validArguments.push_back( Argument( "help", 'h', true ) );
|
15
|
15
|
validArguments.push_back( Argument( "xdisplay", 'x', false ) );
|
16
|
16
|
validArguments.push_back( Argument( "version", 'v', true ) );
|
17
|
17
|
validArguments.push_back( Argument( "quiet", 'q', true ) );
|
18
|
|
- validate( argc, argv );
|
|
18
|
+ try {
|
|
19
|
+ validate( argc, argv );
|
|
20
|
+ } catch( ... ) {
|
|
21
|
+ arguments.clear();
|
|
22
|
+ values.clear();
|
|
23
|
+ floatingValues.clear();
|
|
24
|
+ validArguments[0].isFlagArgument = false;
|
|
25
|
+ validate( argc, argv );
|
|
26
|
+ }
|
19
|
27
|
}
|
20
|
28
|
|
21
|
29
|
|