README.md in fd-0.4.0 vs README.md in fd-0.5.0
- old
+ new
@@ -4,11 +4,11 @@
[![Main workflow: unit tests](https://github.com/s2k/fd/actions/workflows/main.yml/badge.svg)](https://github.com/s2k/fd/actions) <sup style="font-size:125%;">᛫</sup> [![CodeQL for 'fd'](https://github.com/s2k/fd/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/s2k/fd/actions/workflows/codeql-analysis.yml) <sup style="font-size:125%;">᛫</sup> [![Gem Version](https://badge.fury.io/rb/fd.svg)](https://badge.fury.io/rb/fd) <sup style="font-size:125%;">᛫</sup> [![Maintainability](https://api.codeclimate.com/v1/badges/a85527d101c9ed8f581b/maintainability)](https://codeclimate.com/github/s2k/fd/maintainability)
## TL;DR
-`fd` reads files _as a sequence of (UTF-8) characters_ and dumps the content to _STDOUT_, thus the name `fd`. It does so in two columns, the left one will display the hex values of the bytes in the file, the right one will display the characters.
+`fd` reads files (or STDIN) _as a sequence of (UTF-8) characters_ and dumps the content to _STDOUT_, thus the name `fd`. It does so in two columns, the left one will display the hex values of the bytes in the file, the right one will display the characters.
## History
I created this tool **back in 2004**. It was programmed in a different world: On another operating system, using another file system (which most notably didn't have the concept of case-sensitive file names). This version originally used ISO-8859-1 as the default (and only) encoding, while it now assumes UTF-8.
@@ -30,22 +30,26 @@
Or install it yourself as:
$ gem install fd
+Also see the [fd page on rubygems.org](https://rubygems.org/gems/fd)
+
## Usage
You can pass _file names_ on the command line:
```
-fd [-w _number_] [file_names]
+fd [-w number] [file_names]
```
For example:
+
```bash
-> echo "Bacon ipsum dolor amet short ribs flank irure filet mignon brisket buffalo est porchetta." | fd -w 7
-STDIN
+> echo "Bacon ipsum dolor amet short ribs flank irure filet mignon brisket buffalo est porchetta." > some_file
+> fd -w 7 some_file
+some_file
42 61 63 6f 6e 20 69 | B a c o n __ i
70 73 75 6d 20 64 6f | p s u m __ d o
6c 6f 72 20 61 6d 65 | l o r __ a m e
74 20 73 68 6f 72 74 | t __ s h o r t
20 72 69 62 73 20 66 | __ r i b s __ f
@@ -54,15 +58,16 @@
65 74 20 6d 69 67 6e | e t __ m i g n
6f 6e 20 62 72 69 73 | o n __ b r i s
6b 65 74 20 62 75 66 | k e t __ b u f
66 61 6c 6f 20 65 73 | f a l o __ e s
74 20 70 6f 72 63 68 | t __ p o r c h
- 65 74 74 61 2e 0a | e t t a . LF```
+ 65 74 74 61 2e 0a | e t t a . LF
+```
You can also pipe input to STDIN:
```bash
-> echo "Put something into STDIN" | be bin/fd -w 5
+> echo "Put something into STDIN" | fd -w 5
STDIN
50 75 74 20 73 | P u t __ s
6f 6d 65 74 68 | o m e t h
69 6e 67 20 69 | i n g __ i
6e 74 6f 20 53 | n t o __ S