tree: 9036c383b9dc7be45fc5bf9cc0947b7d8a1730dc [path history] [tgz]
  1. example/
  2. lib/
  3. test/
  4. tool/
  5. .gitignore
  6. .status
  7. .travis.yml
  8. analysis_options.yaml
  9. AUTHORS
  10. CHANGELOG.md
  11. codereview.settings
  12. CONTRIBUTING.md
  13. LICENSE
  14. pubspec.yaml
  15. README.md
README.md

cli_util

A library to help in building Dart command-line apps.

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).

Build Status

Usage

import 'dart:io';

import 'package:cli_util/cli_util.dart';
import 'package:path/path.dart' as path;

main(args) {
  // Get sdk dir from cli_util.
  String sdkPath = getSdkPath();
  
  // Do stuff... For example, print version string
  File versionFile = new File(path.join(sdkPath, 'version'));
  print(versionFile.readAsStringSync());
}

Features and bugs

Please file feature requests and bugs at the issue tracker.