equal
deleted
inserted
replaced
13 ARG_GRAPHICS = 'g', |
13 ARG_GRAPHICS = 'g', |
14 ARG_FULLSCREEN = 'F', |
14 ARG_FULLSCREEN = 'F', |
15 ARG_RESOLUTION = 'R', |
15 ARG_RESOLUTION = 'R', |
16 |
16 |
17 ARG_LIST_MODES = 0xff01, |
17 ARG_LIST_MODES = 0xff01, |
|
18 ARG_VERSION = 0xff02, |
18 }; |
19 }; |
19 |
20 |
20 |
21 |
21 /** |
22 /** |
22 * Set the arg_* members |
23 * Set the arg_* members |
45 "set graphics resolution"); |
46 "set graphics resolution"); |
46 |
47 |
47 args.add_option(ARG_LIST_MODES, "list-modes", "", |
48 args.add_option(ARG_LIST_MODES, "list-modes", "", |
48 "output a list of available display modes and exit"); |
49 "output a list of available display modes and exit"); |
49 |
50 |
|
51 args.add_option(ARG_VERSION, "version", "", |
|
52 "output application version and exit"); |
|
53 |
50 // set defaults |
54 // set defaults |
51 arg_graphics = false; |
55 arg_graphics = false; |
52 arg_port = NETWORK_PORT_STR; |
56 arg_port = NETWORK_PORT_STR; |
53 arg_server = false; |
57 arg_server = false; |
54 arg_connect = ""; |
58 arg_connect = ""; |
108 |
112 |
109 case ARG_LIST_MODES: |
113 case ARG_LIST_MODES: |
110 dump_display_modes(); |
114 dump_display_modes(); |
111 return false; |
115 return false; |
112 |
116 |
|
117 case ARG_VERSION: |
|
118 dump_version(); |
|
119 return false; |
|
120 |
113 case CL_CommandLine::REST_ARG: |
121 case CL_CommandLine::REST_ARG: |
114 throw ArgumentError(args.get_argument()); |
122 throw ArgumentError(args.get_argument()); |
115 |
123 |
116 default: |
124 default: |
117 throw ArgumentError(std::string(1, (char) args.get_key())); |
125 throw ArgumentError(std::string(1, (char) args.get_key())); |
147 |
155 |
148 std::cout << "Available display modes:" << std::endl; |
156 std::cout << "Available display modes:" << std::endl; |
149 |
157 |
150 for (std::vector<CL_DisplayMode>::const_iterator it = modes.begin(); it != modes.end(); it++) |
158 for (std::vector<CL_DisplayMode>::const_iterator it = modes.begin(); it != modes.end(); it++) |
151 std::cout << "\t" << it->get_resolution().width << "x" << it->get_resolution().height << std::endl; |
159 std::cout << "\t" << it->get_resolution().width << "x" << it->get_resolution().height << std::endl; |
|
160 } |
|
161 |
|
162 void Main::dump_version (void) { |
|
163 std::cout << PROJECT_LONG_NAME << " version " << PROJECT_VERSION << " built " << PROJECT_BUILD_TIMESTAMP << std::endl; |
152 } |
164 } |
153 |
165 |
154 /** |
166 /** |
155 * IT BEGAN IN AFRIKA |
167 * IT BEGAN IN AFRIKA |
156 */ |
168 */ |