console_app.dart 588 Bytes
Newer Older
derek's avatar
derek committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
import 'dart:async';

import 'package:dl_console/src/console.dart';
import 'package:dl_console/src/console_config.dart' show ConsoleConfig;

/// The application root.
class ConsoleApp {

  ConsoleConfig _consoleConfig;

  Console _console;

  ConsoleApp(ConsoleConfig this._consoleConfig);

  /// Get the application console.
  Console get console {
    if (_console == null) {
      _console = new Console.standard(_consoleConfig);
    }
    return _console;
  }

  /// Run the application.
  Future run(List<String> arguments) async {
    return await this.console.run(arguments);
  }
}