Compare commits
7 commits
Author | SHA1 | Date | |
---|---|---|---|
62cbfb1c71 | |||
5d2f25b3ca | |||
2e7a3ad7b6 | |||
86efa8a8e6 | |||
93fad0cb72 | |||
7854faaa9c | |||
41b24cd6da |
16 changed files with 290 additions and 175 deletions
2
.github/workflows/dart.yml
vendored
2
.github/workflows/dart.yml
vendored
|
@ -24,7 +24,7 @@ jobs:
|
|||
run: |
|
||||
dart test --coverage=coverage
|
||||
dart run coverage:format_coverage --lcov --in=coverage \
|
||||
-out=coverage/lcov.info --packages=.packages --report-on=lib,bin
|
||||
-out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib,bin
|
||||
|
||||
- uses: codecov/codecov-action@v2
|
||||
name: Publish coverage to Codecov
|
||||
|
|
|
@ -1,19 +1,91 @@
|
|||
image: google/dart
|
||||
# You can copy and paste this template into a new `.gitlab-ci.yml` file.
|
||||
# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword.
|
||||
#
|
||||
# To contribute improvements to CI/CD templates, please follow the Development guide at:
|
||||
# https://docs.gitlab.com/ee/development/cicd/templates.html
|
||||
# This specific template is located at:
|
||||
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Dart.gitlab-ci.yml
|
||||
|
||||
# https://hub.docker.com/_/dart
|
||||
image: dart:stable
|
||||
|
||||
variables:
|
||||
# To learn more go to https://dart.dev/tools/dart-test
|
||||
# Or run `dart test --help`
|
||||
PUB_VARS: "--platform vm --timeout 30s --concurrency=6 --test-randomize-ordering-seed=random --reporter=expanded"
|
||||
|
||||
.use-pub-cache-bin:
|
||||
# Define commands that need to be executed before each job.
|
||||
before_script:
|
||||
# Set PUB_CACHE either here or in the CI/CD Settings if you have multiple jobs that use dart commands.
|
||||
# PUB_CACHE is used by the `dart pub` command, it needs to be set so package dependencies are stored at the project-level for CI/CD operations.
|
||||
- export PUB_CACHE=".pub-cache"
|
||||
- export PATH="$PATH:$HOME/$PUB_CACHE/bin"
|
||||
|
||||
# Cache generated files and plugins between builds.
|
||||
.upload-cache:
|
||||
cache:
|
||||
when: 'on_success'
|
||||
paths:
|
||||
- .pub-cache/bin/
|
||||
- .pub-cache/global_packages/
|
||||
- .pub-cache/hosted/
|
||||
- .dart_tool/
|
||||
- .packages
|
||||
|
||||
# Cache downloaded dependencies and plugins between builds.
|
||||
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
|
||||
.download-cache:
|
||||
cache:
|
||||
paths:
|
||||
- .pub-cache/global_packages
|
||||
- .dart_tool/
|
||||
- .packages
|
||||
policy: pull
|
||||
|
||||
before_script:
|
||||
- export PATH="$PATH":"~/.pub-cache/bin"
|
||||
- pub get --no-precompile
|
||||
|
||||
test:
|
||||
stage: test
|
||||
install-dependencies:
|
||||
stage: .pre
|
||||
extends:
|
||||
- .use-pub-cache-bin
|
||||
- .upload-cache
|
||||
script:
|
||||
- pub run test $PUB_VARS
|
||||
- dart pub get --no-precompile
|
||||
|
||||
build:
|
||||
stage: build
|
||||
needs:
|
||||
- install-dependencies
|
||||
extends:
|
||||
- .use-pub-cache-bin
|
||||
- .upload-cache
|
||||
script:
|
||||
- dart pub get --offline --precompile
|
||||
|
||||
unit-test:
|
||||
stage: test
|
||||
needs:
|
||||
- build
|
||||
extends:
|
||||
- .use-pub-cache-bin
|
||||
- .download-cache
|
||||
script:
|
||||
- dart test $PUB_VARS
|
||||
|
||||
lint-test:
|
||||
stage: test
|
||||
needs:
|
||||
- install-dependencies
|
||||
extends:
|
||||
- .use-pub-cache-bin
|
||||
- .download-cache
|
||||
script:
|
||||
- dart analyze .
|
||||
|
||||
format-test:
|
||||
stage: test
|
||||
needs:
|
||||
- install-dependencies
|
||||
extends:
|
||||
- .use-pub-cache-bin
|
||||
- .download-cache
|
||||
script:
|
||||
- dart format --set-exit-if-changed bin/ lib/ test/
|
3
.idea/misc.xml
generated
3
.idea/misc.xml
generated
|
@ -1,5 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PDMPlugin">
|
||||
<option name="skipTestSources" value="false" />
|
||||
</component>
|
||||
<component name="ProjectRootManager">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
|
|
10
.idea/runConfigurations.xml
generated
10
.idea/runConfigurations.xml
generated
|
@ -1,10 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
|
@ -1,3 +1,7 @@
|
|||
## 1.0.1
|
||||
|
||||
- Minor improvements.
|
||||
|
||||
## 1.0.0
|
||||
|
||||
- Initial version.
|
||||
|
|
28
README.md
28
README.md
|
@ -1,21 +1,23 @@
|
|||
[](http://opensource.org/licenses/BSD-3-Clause)
|
||||
[](https://opensource.org/licenses/BSD-3-Clause)
|
||||
[](https://github.com/ethauvin/dcat/actions/workflows/dart.yml)
|
||||
[](https://codecov.io/gh/ethauvin/dcat)
|
||||
[](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
|
||||
|
||||
```sh
|
||||
```console
|
||||
dcat --help
|
||||
```
|
||||
```
|
||||
|
||||
```text
|
||||
Usage: dcat [OPTION]... [FILE]...
|
||||
Concatenate FILE(s) to standard output.
|
||||
|
||||
|
@ -30,27 +32,31 @@ 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.
|
||||
dcat Copy standard input to standard output.
|
||||
```
|
||||
|
||||
## Compile Standalone Application
|
||||
|
||||
### *nix
|
||||
```sh
|
||||
### Linux / MacOS
|
||||
|
||||
```console
|
||||
dart compile exe -o bin/dcat bin/dcat.dart
|
||||
```
|
||||
|
||||
### Windows
|
||||
```cmd
|
||||
|
||||
```console
|
||||
dart compile exe bin/dcat.dart
|
||||
```
|
||||
|
||||
## Library Usage
|
||||
```sh
|
||||
|
||||
```console
|
||||
dart pub add dcat
|
||||
```
|
||||
|
||||
|
@ -66,6 +72,8 @@ if (result.isFailure) {
|
|||
}
|
||||
```
|
||||
|
||||
[View Full Instructions](https://pub.dev/packages/dcat/install)
|
||||
|
||||
The `cat` function supports the following parameters:
|
||||
|
||||
Parameter | Description | Type
|
||||
|
|
1
analyze.sh
Executable file
1
analyze.sh
Executable file
|
@ -0,0 +1 @@
|
|||
dart analyze .
|
|
@ -113,13 +113,13 @@ Future<ArgParser> setupArgsParser() async {
|
|||
negatable: false,
|
||||
abbr: 's',
|
||||
help: 'suppress repeated empty output lines');
|
||||
parser.addFlag(versionFlag,
|
||||
negatable: false, help: 'output version information and exit');
|
||||
parser.addFlag('ignored', negatable: false, hide: true, abbr: 'u');
|
||||
parser.addFlag(showNonPrintingFlag,
|
||||
negatable: false,
|
||||
abbr: 'v',
|
||||
help: 'use ^ and M- notation, except for LFD and TAB');
|
||||
parser.addFlag(versionFlag,
|
||||
negatable: false, help: 'output version information and exit');
|
||||
|
||||
return parser;
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ Future<ArgParser> setupArgsParser() async {
|
|||
// Prints an error to stderr.
|
||||
Future<void> printError(CatError error) async {
|
||||
stderr.writeln(
|
||||
'$appName: ' + (error.hasPath ? '${error.path}: ' : '') + error.message);
|
||||
'$appName: ${error.hasPath ? '${error.path}: ' : ''}${error.message}');
|
||||
}
|
||||
|
||||
// Prints the version info.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
dart run test --coverage=coverage
|
||||
dart run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.packages --report-on=lib,bin
|
||||
dart run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib,bin
|
||||
genhtml -o coverage coverage/lcov.info
|
||||
open coverage/index.html 2>/dev/null
|
||||
|
|
2
docs.sh
2
docs.sh
|
@ -1,2 +1,2 @@
|
|||
dart doc
|
||||
open doc/api/index.html 2> /dev/null
|
||||
xdg-open doc/api/index.html 2>/dev/null
|
||||
|
|
1
format.sh
Executable file
1
format.sh
Executable file
|
@ -0,0 +1 @@
|
|||
dart format bin lib test example
|
|
@ -19,6 +19,7 @@ const _lineFeed = 10;
|
|||
class CatError {
|
||||
/// The error message.
|
||||
String message;
|
||||
|
||||
/// The file path, if any.
|
||||
String? path;
|
||||
|
||||
|
@ -35,8 +36,6 @@ class CatResult {
|
|||
/// The list of errors.
|
||||
final List<CatError> errors = [];
|
||||
|
||||
CatResult();
|
||||
|
||||
/// Returns `true` if the [exitCode] is [exitFailure].
|
||||
bool get isFailure => exitCode == exitFailure;
|
||||
|
||||
|
@ -46,11 +45,7 @@ class CatResult {
|
|||
/// Adds an error [message] and [path].
|
||||
void addError(String message, {String? path}) {
|
||||
exitCode = exitFailure;
|
||||
if (path != null && path.isNotEmpty) {
|
||||
errors.add(CatError(message, path: path));
|
||||
} else {
|
||||
errors.add(CatError(message));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -146,13 +141,12 @@ Future<void> _copyStream(
|
|||
squeeze = 0;
|
||||
}
|
||||
}
|
||||
if (showLineNumbers || numberNonBlank) {
|
||||
if (!numberNonBlank || ch != _lineFeed) {
|
||||
if ((showLineNumbers || numberNonBlank) &&
|
||||
(!numberNonBlank || ch != _lineFeed)) {
|
||||
buff.addAll('${++lastLine.lineNumber}'.padLeft(6).codeUnits);
|
||||
buff.add(tab);
|
||||
}
|
||||
}
|
||||
}
|
||||
lastLine.lastChar = ch;
|
||||
if (ch == _lineFeed) {
|
||||
if (showEnds) {
|
||||
|
|
249
pubspec.lock
249
pubspec.lock
|
@ -5,344 +5,377 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: _fe_analyzer_shared
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "36a321c3d2cbe01cbcb3540a87b8843846e0206df3e691fa7b23e19e78de6d49"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "34.0.0"
|
||||
version: "65.0.0"
|
||||
analyzer:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: analyzer
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: dfe03b90ec022450e22513b5e5ca1f01c0c01de9c3fba2f7fd233cb57a6b9a07
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.2.0"
|
||||
version: "6.3.0"
|
||||
args:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: args
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.0"
|
||||
version: "2.4.2"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.8.2"
|
||||
version: "2.11.0"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.1"
|
||||
cli_util:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: cli_util
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.3.5"
|
||||
version: "2.1.1"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.15.0"
|
||||
version: "1.18.0"
|
||||
convert:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: convert
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
version: "3.1.1"
|
||||
coverage:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: coverage
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "8acabb8306b57a409bf4c83522065672ee13179297a6bb0cb9ead73948df7c76"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.7.2"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: crypto
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
version: "3.0.3"
|
||||
file:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: file
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.2"
|
||||
version: "7.0.0"
|
||||
frontend_server_client:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: frontend_server_client
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
version: "3.2.0"
|
||||
glob:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: glob
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.2"
|
||||
version: "2.1.2"
|
||||
http_multi_server:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: http_multi_server
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
version: "3.2.1"
|
||||
http_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: http_parser
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
version: "4.0.2"
|
||||
indent:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: indent
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "819319a5c185f7fe412750c798953378b37a0d0d32564ce33e7c5acfd1372d2a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
io:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: io
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.3"
|
||||
version: "1.0.4"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: js
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.3"
|
||||
version: "0.6.7"
|
||||
lints:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: lints
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
version: "3.0.0"
|
||||
logging:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: logging
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.2"
|
||||
version: "1.2.0"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.12.11"
|
||||
version: "0.12.16+1"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.7.0"
|
||||
version: "1.11.0"
|
||||
mime:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: mime
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
version: "1.0.4"
|
||||
node_preamble:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: node_preamble
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
version: "2.0.2"
|
||||
package_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: package_config
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.2"
|
||||
version: "2.1.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.8.1"
|
||||
version: "1.9.0"
|
||||
pool:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pool
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.5.0"
|
||||
version: "1.5.1"
|
||||
pub_semver:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pub_semver
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.1.4"
|
||||
shelf:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shelf
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.4.1"
|
||||
shelf_packages_handler:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shelf_packages_handler
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.0"
|
||||
version: "3.0.2"
|
||||
shelf_static:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shelf_static
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.1.2"
|
||||
shelf_web_socket:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shelf_web_socket
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
version: "1.0.4"
|
||||
source_map_stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_map_stack_trace
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.1.1"
|
||||
source_maps:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_maps
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.10.10"
|
||||
version: "0.10.12"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.8.2"
|
||||
version: "1.10.0"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.10.0"
|
||||
version: "1.11.1"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.1.2"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.2.0"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.2.1"
|
||||
test:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: test
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "3d028996109ad5c253674c7f347822fb994a087614d6f353e6039704b4661ff2"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.20.1"
|
||||
version: "1.25.0"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.4.9"
|
||||
version: "0.7.0"
|
||||
test_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_core
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "2bc4b4ecddd75309300d8096f781c0e3280ca1ef85beda558d33fcbedc2eead4"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.4.11"
|
||||
version: "0.6.0"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "1.3.2"
|
||||
vm_service:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vm_service
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: a2662fb1f114f4296cf3f5a50786a2d888268d7776cf681aa17d660ffa23b246
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "8.1.0"
|
||||
version: "14.0.0"
|
||||
watcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: watcher
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
version: "1.1.0"
|
||||
web_socket_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: web_socket_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.4.0"
|
||||
webkit_inspection_protocol:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: webkit_inspection_protocol
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
version: "1.2.1"
|
||||
yaml:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: yaml
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
version: "3.1.2"
|
||||
sdks:
|
||||
dart: ">=2.15.1 <3.0.0"
|
||||
dart: ">=3.0.0 <=3.2.3"
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
name: dcat
|
||||
description: Concatenate file(s) to standard output or file
|
||||
version: 1.0.0
|
||||
description: An implementation of the standard cat Unix utility that concatenates file(s) to standard output or file.
|
||||
version: 1.0.1
|
||||
repository: https://github.com/ethauvin/dcat
|
||||
issue_tracker: https://github.com/ethauvin/dcat/issues
|
||||
|
||||
environment:
|
||||
sdk: '>=2.15.1 <3.0.0'
|
||||
sdk: '>=2.15.1 <=3.2.3'
|
||||
|
||||
dev_dependencies:
|
||||
lints: ^1.0.0
|
||||
lints: ^3.0.0
|
||||
test: ^1.18.2
|
||||
dependencies:
|
||||
args: ^2.3.0
|
||||
|
|
21
test.sh
21
test.sh
|
@ -5,18 +5,27 @@ TMPDCAT=/tmp/tmp-dcat
|
|||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
|
||||
for o in -A -b -e -E -n -s -t -T -v
|
||||
checkDiff () {
|
||||
if ! $(cmp -s $TMPCAT $TMPDCAT);
|
||||
then
|
||||
echo -e "${RED}Test failed: $1" >&2
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
for o in '' -A -b -e -E -n -s -t -T -v '-Abs'
|
||||
do
|
||||
echo -e "Testing: cat $o"
|
||||
cat $o test/* > $TMPCAT
|
||||
bin/dcat $o test/* > $TMPDCAT
|
||||
if ! $(diff -q $TMPCAT $TMPDCAT);
|
||||
then
|
||||
echo -e "${RED}Test failed: $o" >&2
|
||||
exit
|
||||
fi
|
||||
checkDiff "cat $o"
|
||||
done
|
||||
|
||||
echo -e "Testing: cat -"
|
||||
echo "This is a test" | cat - test/* > $TMPCAT
|
||||
echo "This is a test" | bin/dcat - test/* > $TMPDCAT
|
||||
checkDiff "cat -"
|
||||
|
||||
rm -rf $TMPCAT $TMPDCAT
|
||||
|
||||
echo -e "${GREEN}All tests passed."
|
||||
|
|
|
@ -16,16 +16,16 @@ void main() {
|
|||
const sourceFile = 'bin/dcat.dart';
|
||||
|
||||
int exitCode;
|
||||
final tempDir = Directory.systemTemp.createTempSync();
|
||||
final tmpDir = Directory.systemTemp.createTempSync();
|
||||
|
||||
Stream<List<int>> mockStdin({String text = sampleText}) async* {
|
||||
yield text.codeUnits;
|
||||
}
|
||||
|
||||
File makeTmpFile() =>
|
||||
File("${tempDir.path}/tmp-${DateTime.now().millisecondsSinceEpoch}.txt");
|
||||
File("${tmpDir.path}/${DateTime.now().millisecondsSinceEpoch}.txt");
|
||||
|
||||
tearDownAll(() => tempDir.delete(recursive: true));
|
||||
tearDownAll(() => tmpDir.delete(recursive: true));
|
||||
|
||||
group('app', () {
|
||||
test('--help', () async {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue