Concatenate file(s) to standard output or file https://github.com/ethauvin/dcat
Find a file
2021-10-11 02:44:02 -07:00
.github/workflows Added GitHub CI Action 2021-10-09 19:58:42 -07:00
.idea Initial commit. 2021-10-09 17:18:56 -07:00
bin Added more test coverage. 2021-10-11 02:44:02 -07:00
doc/api Added show non-printing option. 2021-10-10 20:23:09 -07:00
lib Added show non-printing option. 2021-10-10 20:23:09 -07:00
test Added more test coverage. 2021-10-11 02:44:02 -07:00
.gitignore Added more test coverage. 2021-10-11 02:44:02 -07:00
analysis_options.yaml Initial commit. 2021-10-09 17:18:56 -07:00
CHANGELOG.md Initial commit. 2021-10-09 17:18:56 -07:00
coverage.sh Added more test coverage. 2021-10-11 02:44:02 -07:00
dcat.iml Initial commit. 2021-10-09 17:18:56 -07:00
LICENSE Initial commit. 2021-10-09 17:18:56 -07:00
pubspec.lock Initial commit. 2021-10-09 17:18:56 -07:00
pubspec.yaml Added show non-printing option. 2021-10-10 20:23:09 -07:00
README.md Added show non-printing option. 2021-10-10 20:23:09 -07:00

License (3-Clause BSD) GitHub CI

dcat: Concatenate File(s) to Standard Output

A cat command-line implemenation in Dart, inspired by the Write command-line apps sample code.

Synopsis

dcat copies each file, or standard input if none are given, to standard output.

Command-Line Usage

dcat --help
Usage: dcat [OPTION]... [FILE]...
Concatenate FILE(s) to standard output.

With no FILE, or when FILE is -, read standard input.

  -A, --show-all                 equivalent to -vET
  -b, --number-nonblank          number nonempty output lines, overrides -n
  -e, --show-nonprinting-ends    equivalent to -vE
  -E, --show-ends                display $ at end of each line
  -h, --help                     display this help and exit
  -n, --number                   number all output lines
  -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

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

dart compile exe -o bin/dcat bin/dcat.dart

Windows

dart compile exe bin/dcat.dart

Differences from GNU cat

  • No binary file support.
  • A line is considered terminated by either a CR (carriage return), a LF (line feed), a CR+LF sequence (DOS line ending).
  • The non-printing M-^? notation is always used for unicode characters.