| 255 | } |
| 256 | |
| 257 | @Override |
| 258 | protected void parseArgs() throws IOException { |
| 259 | /* command-line properties will be stored in system properties; |
| 260 | * this way, they will not be overwritten by the settings specified in web.xml. */ |
| 261 | final MainParser arg = new MainParser(this); |
| 262 | boolean daemon = true; |
| 263 | |
| 264 | while(arg.more()) { |
| 265 | if(arg.dash()) { |
| 266 | switch(arg.next()) { |
| 267 | case 'c': // database command |
| 268 | commands.add(commands(arg.string())); |
| 269 | break; |
| 270 | case 'C': // command script |
| 271 | commands.add(script(arg.string())); |
| 272 | break; |
| 273 | case 'd': // activate debug mode |
| 274 | Prop.put(StaticOptions.DEBUG, Boolean.toString(true)); |
| 275 | Prop.debug = true; |
| 276 | break; |
| 277 | case 'D': // hidden flag: daemon mode |
| 278 | daemon = false; |
| 279 | break; |
| 280 | case 'g': // enable GZIP compression |
| 281 | Prop.put(StaticOptions.GZIP, Boolean.toString(true)); |
| 282 | break; |
| 283 | case 'h': // parse HTTP port |
| 284 | port = arg.number(); |
| 285 | break; |
| 286 | case 'l': // use local mode |
| 287 | Prop.put(StaticOptions.HTTPLOCAL, Boolean.toString(true)); |
| 288 | break; |
| 289 | case 'n': // parse host name |
| 290 | final String n = arg.string(); |
| 291 | Prop.put(StaticOptions.HOST, n); |
| 292 | Prop.put(StaticOptions.SERVERHOST, n); |
| 293 | break; |
| 294 | case 'p': // parse server port |
| 295 | final int p = arg.number(); |
| 296 | Prop.put(StaticOptions.PORT, Integer.toString(p)); |
| 297 | Prop.put(StaticOptions.SERVERPORT, Integer.toString(p)); |
| 298 | break; |
| 299 | case 'q': // quiet flag (hidden) |
| 300 | quiet = true; |
| 301 | break; |
| 302 | case 's': // parse stop port |
| 303 | Prop.put(StaticOptions.STOPPORT, Integer.toString(arg.number())); |
| 304 | break; |
| 305 | case 'S': // set service flag |
| 306 | service = daemon; |
| 307 | break; |
| 308 | case 'U': // specify username |
| 309 | Prop.put(StaticOptions.USER, arg.string()); |
| 310 | break; |
| 311 | case 'z': // suppress logging |
| 312 | Prop.put(StaticOptions.LOG, ""); |
| 313 | break; |
| 314 | default: |