From bdd3997eb160859abbef530893937682abf565e5 Mon Sep 17 00:00:00 2001 From: Riccardo Attilio Galli Date: Sat, 30 May 2020 01:09:04 -0700 Subject: [PATCH] Add README --- README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..d9d0203 --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ +# tuc (when cut doesn't cut it) + +## Help + +``` +tuc 0.1.0 +When cut doesn't cut it. + +USAGE: + tuc [FLAGS] [OPTIONS] + +FLAGS: + -p Display the delimiter at most once in a sequence + -h, --help Prints help information + -s, --only-delimited Do not print lines not containing delimiters + -V, --version Prints version information + +OPTIONS: + -d, --delimiter Delimiter to use to cut the text into pieces [default: ] + -f, --fields Fields to keep, like 1:3 or 3,2 or 1: or 3,1:2 or -3 or -3:-2 [default: 1:] + -r Replace the delimiter + -t Valid trim values are (l|L)eft, (r|R)ight, (b|B)oth +``` + +## Examples + +``` +# Cut using a greedy delimiter +$ echo "foo bar baz" | tuc -d ' ' -f 2: +bar baz +``` + +``` +# Compress delimiters after cut +$ echo "foo bar baz" | tuc -d ' ' -f 2: -p +bar baz +``` + +``` +# Replace remaining delimiters with something else +$ echo "foo bar baz" | tuc -d ' ' -f 2: -p -r '/' +bar/baz +```