OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library http_server_runner; | 5 library http_server_runner; |
6 import 'dart:io'; | 6 import 'dart:io'; |
7 import 'http_server.dart'; | 7 import 'http_server.dart'; |
8 | 8 |
9 main() { | 9 main(List<String> arguments) { |
10 var optionsParser = getOptionParser(); | 10 var optionsParser = getOptionParser(); |
11 try { | 11 try { |
12 var argResults = optionsParser.parse(new Options().arguments); | 12 var argResults = optionsParser.parse(arguments); |
13 var server = new HttpTestServer( | 13 var server = new HttpTestServer( |
14 int.parse(argResults['port']), | 14 int.parse(argResults['port']), |
15 argResults['root']); | 15 argResults['root']); |
16 } catch (e) { | 16 } catch (e) { |
17 print(e); | 17 print(e); |
18 print('Usage: http_server_runner.dart <options>'); | 18 print('Usage: http_server_runner.dart <options>'); |
19 print(optionsParser.getUsage()); | 19 print(optionsParser.getUsage()); |
20 } | 20 } |
21 } | 21 } |
OLD | NEW |