Skip to content

Commit dec7d29

Browse files
committed
Update README.md
1 parent 2cf24bb commit dec7d29

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

pkgs/cli_util/README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,33 @@
11
# cli_util
22

3-
A micro framework for building commandline apps.
3+
Utilities to help in building Dart command-line apps.
4+
5+
In particular, ``cli_util`` provides a simple, standardized way to get the current SDK directory. Useful, especially, when building client applications that interact with the Dart SDK (such as the [analyzer](https://pub.dartlang.org/packages/analyzer)).
6+
7+
## Install
8+
9+
```shell
10+
pub global activate cli_util
11+
```
12+
13+
## Usage
14+
15+
```dart
16+
import 'dart:io';
17+
18+
import 'package:cli_util/cli_util.dart';
19+
import 'package:path/path.dart' as path;
20+
21+
main(args) {
22+
23+
// Get sdk dir from cli_util
24+
Directory sdkDir = getSdkDir(args);
25+
26+
// Do stuff... For example, print version string
27+
File versionFile = new File(path.join(sdkDir.path, 'version'));
28+
print(versionFile.readAsStringSync());
29+
}
30+
```
431

532
## Features and bugs
633

0 commit comments

Comments
 (0)