cli_util 0.2.0 copy "cli_util: ^0.2.0" to clipboard
cli_util: ^0.2.0 copied to clipboard

outdated

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

example/main.dart

// Copyright (c) 2017, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:async';

import 'package:cli_util/cli_logging.dart';

main(List<String> args) async {
  bool verbose = args.contains('-v');
  Logger logger = verbose ? new Logger.verbose() : new Logger.standard();

  logger.stdout('Hello world!');
  logger.trace('message 1');
  await new Future.delayed(new Duration(milliseconds: 200));
  logger.trace('message 2');
  logger.trace('message 3');

  Progress progress = logger.progress('doing some work');
  await new Future.delayed(new Duration(seconds: 2));
  progress.finish(showTiming: true);

  logger.stdout('All ${logger.ansi.emphasized('done')}.');
}
73
likes
0
pub points
97%
popularity

Publisher

verified publishertools.dart.dev

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

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

path

More

Packages that depend on cli_util