From d6cef57de7023591fa4d140118f740a0a07150d9 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Wed, 20 Oct 2021 22:43:05 -0700 Subject: [PATCH] Added example. --- example/example.dart | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 example/example.dart diff --git a/example/example.dart b/example/example.dart new file mode 100644 index 0000000..53c9d58 --- /dev/null +++ b/example/example.dart @@ -0,0 +1,14 @@ +import 'dart:io'; + +import 'package:dcat/dcat.dart'; + +// Usage: dart example.dart file... +Future main(List 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}"); + } + } +}