summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-11-16 14:58:31 -0500
committerTavian Barnes <tavianator@tavianator.com>2022-11-16 14:58:31 -0500
commitd9b4950e8e42ac6a608457d3903817a5560107bd (patch)
tree93e04645a2cc9a567bca8dea405920bcf5e8fb50
parent723113d5cf37a158a5d647fcb56079047c3d9f2a (diff)
downloadbfs-d9b4950e8e42ac6a608457d3903817a5560107bd.tar.xz
README: Use `console` syntax highlighting more
-rw-r--r--README.md55
1 files changed, 33 insertions, 22 deletions
diff --git a/README.md b/README.md
index c395342..643668c 100644
--- a/README.md
+++ b/README.md
@@ -71,9 +71,16 @@ haystack
</pre>
`find` will explore the entire `deep` directory tree before it ever gets to the `shallow` one that contains what you're looking for.
+On the other hand, `bfs` lists files from shallowest to deepest, so you never have to wait for it to explore an entire unrelated subtree.
-<pre>
-$ <strong>find</strong> haystack
+<table>
+<tbody>
+<tr><th><code>bfs</code></th><th><code>find</code></th></tr>
+<tr>
+<td width="506" valign="top">
+
+```console
+$ find haystack
haystack
haystack/deep
haystack/deep/1
@@ -82,23 +89,26 @@ haystack/deep/1/2/3
haystack/deep/1/2/3/4
...
haystack/shallow
-<strong>haystack/shallow/needle</strong>
-</pre>
+haystack/shallow/needle
+```
-On the other hand, `bfs` lists files from shallowest to deepest, so you never have to wait for it to explore an entire unrelated subtree.
+</td>
+<td width="506" valign="top">
-<pre>
-$ <strong>bfs</strong> haystack
+```console
+$ bfs haystack
haystack
haystack/deep
haystack/shallow
haystack/deep/1
-<strong>haystack/shallow/needle</strong>
-haystack/deep/1/2
-haystack/deep/1/2/3
-haystack/deep/1/2/3/4
+haystack/shallow/needle
...
-</pre>
+```
+
+</td>
+</tr>
+</tbody>
+</table>
</details>
<details>
@@ -154,21 +164,22 @@ haystack/needle
For example, `bfs` will detect and suggest corrections for typos:
-<pre>
+```console
$ bfs -nam needle
-<strong>bfs: error:</strong> bfs <strong>-nam</strong> needle
-<strong>bfs: error:</strong> <strong>~~~~</strong>
-<strong>bfs: error:</strong> Unknown argument; did you mean <strong>-name</strong>?
-</pre>
+bfs: error: bfs -nam needle
+bfs: error: ~~~~
+bfs: error: Unknown argument; did you mean -name?
+```
`bfs` also includes a powerful static analysis to help catch mistakes:
-<pre>
+```console
$ bfs -print -name 'needle'
-<strong>bfs: warning:</strong> bfs -print <strong>-name needle</strong>
-<strong>bfs: warning:</strong> <strong>~~~~~~~~~~~~</strong>
-<strong>bfs: warning:</strong> The result of this expression is ignored.
-</pre>
+bfs: warning: bfs -print -name needle
+bfs: warning: ~~~~~~~~~~~~
+bfs: warning: The result of this expression is ignored.
+```
+
</details>
<details>