From 7854faaa9c3d92319214797968a2bb98b5eb7dfa Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Thu, 27 Jan 2022 23:01:19 -0800 Subject: [PATCH] Fixes suggested by pub.dev. --- README.md | 11 ++++++----- analyze.sh | 1 + format.sh | 1 + lib/dcat.dart | 1 + pubspec.yaml | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) create mode 100755 analyze.sh create mode 100755 format.sh diff --git a/README.md b/README.md index e1e6bca..bca4deb 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ -[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](http://opensource.org/licenses/BSD-3-Clause) +[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](https://opensource.org/licenses/BSD-3-Clause) [![GitHub CI](https://github.com/ethauvin/dcat/actions/workflows/dart.yml/badge.svg)](https://github.com/ethauvin/dcat/actions/workflows/dart.yml) [![codecov](https://codecov.io/gh/ethauvin/dcat/branch/master/graph/badge.svg?token=9PC4K4IZXJ)](https://codecov.io/gh/ethauvin/dcat) [![pub package](https://img.shields.io/pub/v/dcat.svg)](https://pub.dev/packages/dcat) # dcat: Concatenate File(s) to Standard Output or File -A **cat** command-line and library implementation in [Dart](https://dart.dev/), inspired by the [Write command-line apps sample code](https://dart.dev/tutorials/server/cmdline). +A [Dart](https://dart.dev/) command-line and library implementation of the standard **cat** Unix utility, inspired by the [Write command-line apps sample code](https://dart.dev/tutorials/server/cmdline). ## Synopsis -**dcat** copies each file, or standard input if none are given, to standard output or file. +**dcat** sequentially reads files, or standard input if none are given, writing them to standard output or file. ## Command-Line Usage @@ -31,8 +31,8 @@ With no FILE, or when FILE is -, read standard input. -t, --show-nonprinting-tabs equivalent to -vT -T, --show-tabs display TAB characters as ^I -s, --squeeze-blank suppress repeated empty output lines - --version output version information and exit -v, --show-nonprinting use ^ and M- notation, except for LFD and TAB + --version output version information and exit Examples: dcat f - g Output f's contents, then standard input, then g's contents. @@ -40,7 +40,7 @@ Examples: ``` ## Compile Standalone Application -### *nix +### Linux / MacOS ```sh dart compile exe -o bin/dcat bin/dcat.dart ``` @@ -66,6 +66,7 @@ if (result.isFailure) { } } ``` +[View Full Instructions](https://pub.dev/packages/dcat/install) The `cat` function supports the following parameters: diff --git a/analyze.sh b/analyze.sh new file mode 100755 index 0000000..6471fcf --- /dev/null +++ b/analyze.sh @@ -0,0 +1 @@ +dart analyze . diff --git a/format.sh b/format.sh new file mode 100755 index 0000000..81b9bd6 --- /dev/null +++ b/format.sh @@ -0,0 +1 @@ +dart format bin lib test example diff --git a/lib/dcat.dart b/lib/dcat.dart index 5a09b93..5bf9b96 100644 --- a/lib/dcat.dart +++ b/lib/dcat.dart @@ -19,6 +19,7 @@ const _lineFeed = 10; class CatError { /// The error message. String message; + /// The file path, if any. String? path; diff --git a/pubspec.yaml b/pubspec.yaml index 06afdeb..4bce105 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: dcat -description: Concatenate file(s) to standard output or file +description: An implementation of the standard cat Unix utility that concatenates file(s) to standard output or file. version: 1.0.0 repository: https://github.com/ethauvin/dcat issue_tracker: https://github.com/ethauvin/dcat/issues