38506f9d57
The LineTransformer has been retired, and is replaced with LineSplitter from dart:convert R=floitsch@google.com, nweiz@google.com Review URL: https://codereview.chromium.org//22927016 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26419 260f80e4-7a28-3924-810f-c04153c831b5
20 lines
574 B
Dart
20 lines
574 B
Dart
// Copyright (c) 2013, 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.
|
|
//
|
|
// Utility script to echo stdin to stdout or stderr or both.
|
|
|
|
import "dart:convert";
|
|
import "dart:io";
|
|
|
|
main() {
|
|
var subscription;
|
|
subscription = stdin
|
|
.transform(new StringDecoder())
|
|
.transform(new LineSplitter())
|
|
.listen((String line) {
|
|
// Unsubscribe after the first line.
|
|
subscription.cancel();
|
|
});
|
|
}
|