File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -21,23 +21,30 @@ int main(int ac, char* av[])
21
21
desc.add_options ()
22
22
(" help" , " produce help message" )
23
23
(" compression" , po::value<int >(), " set compression level" )
24
+ (" verbose" , po::value<string>()->zero_tokens ()->implicit_value (" " ))
24
25
;
25
26
26
- po::variables_map vm;
27
+ po::variables_map vm;
27
28
po::store (po::parse_command_line (ac, av, desc), vm);
28
- po::notify (vm);
29
+ po::notify (vm);
29
30
30
31
if (vm.count (" help" )) {
31
32
cout << desc << " \n " ;
32
33
return 1 ;
33
34
}
34
35
35
36
if (vm.count (" compression" )) {
36
- cout << " Compression level was set to "
37
+ cout << " Compression level was set to "
37
38
<< vm[" compression" ].as <int >() << " .\n " ;
38
39
} else {
39
40
cout << " Compression level was not set.\n " ;
40
41
}
42
+
43
+ if (vm.count (" verbose" )) {
44
+ string v = vm[" verbose" ].as <string>();
45
+ if (v.size () > 0 )
46
+ cout << " Verbosity is: " << v << " .\n " ;
47
+ }
41
48
}
42
49
catch (exception& e) {
43
50
cerr << " error: " << e.what () << " \n " ;
You can’t perform that action at this time.
0 commit comments