OLD | NEW |
(Empty) | |
| 1 # cli_util |
| 2 |
| 3 A library to help in building Dart command-line apps. |
| 4 |
| 5 In particular, `cli_util` provides a simple, standardized way to get the current |
| 6 SDK directory. Useful, especially, when building client applications that |
| 7 interact with the Dart SDK (such as the [analyzer][analyzer]). |
| 8 |
| 9 [](https://travis-c
i.org/dart-lang/cli_util) |
| 10 |
| 11 ## Usage |
| 12 |
| 13 ```dart |
| 14 import 'dart:io'; |
| 15 |
| 16 import 'package:cli_util/cli_util.dart'; |
| 17 import 'package:path/path.dart' as path; |
| 18 |
| 19 main(args) { |
| 20 // Get sdk dir from cli_util |
| 21 Directory sdkDir = getSdkDir(args); |
| 22 |
| 23 // Do stuff... For example, print version string |
| 24 File versionFile = new File(path.join(sdkDir.path, 'version')); |
| 25 print(versionFile.readAsStringSync()); |
| 26 } |
| 27 ``` |
| 28 |
| 29 ## Features and bugs |
| 30 |
| 31 Please file feature requests and bugs at the [issue tracker][tracker]. |
| 32 |
| 33 [analyzer]: https://pub.dartlang.org/packages/analyzer |
| 34 [tracker]: https://github.com/dart-lang/cli_util/issues |
OLD | NEW |