Added example.
This commit is contained in:
parent
9593799e2a
commit
d6cef57de7
1 changed files with 14 additions and 0 deletions
14
example/example.dart
Normal file
14
example/example.dart
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:dcat/dcat.dart';
|
||||||
|
|
||||||
|
// Usage: dart example.dart file...
|
||||||
|
Future<void> main(List<String> arguments) async {
|
||||||
|
// Display the file(s) with line numbers to the standard output
|
||||||
|
final result = await cat(arguments, stdout, showLineNumbers: true);
|
||||||
|
if (result.isFailure) {
|
||||||
|
for (final error in result.errors) {
|
||||||
|
print("Error with '${error.path}': ${error.message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue