Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | |
| 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. | |
| 4 | |
| 5 /** | |
| 6 * Simple command line interface to launcing browsers. | |
|
kustermann
2013/05/29 11:58:00
launcing -> launching
ricow1
2013/05/29 12:08:23
Done.
| |
| 7 * Uses the browser_controller framework. | |
| 8 * The usage is: | |
| 9 * DARTBIN launch_browser.dart BROWSER_NAME URL | |
| 10 * DARTBIN should be the checked in stable binary. | |
| 11 */ | |
| 12 | |
| 13 import "dart:io"; | |
| 14 import "browser_controller.dart"; | |
| 15 | |
| 16 | |
| 17 bool supportedBrowser(String browser) { | |
| 18 return | |
| 19 } | |
|
kustermann
2013/05/29 11:58:00
This function can be removed now.
ricow1
2013/05/29 12:08:23
Done.
| |
| 20 | |
| 21 void printHelp() { | |
| 22 print("Usage pattern:"); | |
| 23 print("launch_browser.dart browser url"); | |
| 24 print("Supported browsers: ${Browser.SUPPORTED_BROWSERS}"); | |
| 25 } | |
| 26 | |
| 27 void main() { | |
| 28 var args = new Options().arguments; | |
| 29 if (args.length != 2) { | |
| 30 print("Wrong number of arguments, please pass in exactly two arguments"); | |
| 31 printHelp(); | |
| 32 return; | |
| 33 } | |
| 34 | |
| 35 if (!Browser.supportedBrowser(args[0])) { | |
| 36 print("Specified browser not supported"); | |
| 37 printHelp(); | |
| 38 return; | |
| 39 } | |
| 40 | |
| 41 var browser = new Browser.byName(args[0]); | |
| 42 browser.start(args[1]); | |
| 43 | |
| 44 } | |
| OLD | NEW |