summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-03-27 13:44:43 -0400
committerTavian Barnes <tavianator@tavianator.com>2022-03-27 13:44:43 -0400
commitc5ad36dd179c63517738cecaaf8474d8fd665a98 (patch)
tree82e675e76cf0140fef5c5712f773e2664304dc38
parentcae04995dbb55b24e746c36a8ad326a3438d4103 (diff)
downloadbfs-c5ad36dd179c63517738cecaaf8474d8fd665a98.tar.xz
README: Add a blurb about fancy errors/warnings
-rw-r--r--README.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/README.md b/README.md
index c68dd97..0ebac8f 100644
--- a/README.md
+++ b/README.md
@@ -89,6 +89,28 @@ $ <strong>bfs</strong> -L <em>haystack</em> -name 'needle' │ $ <strong>find
</details>
<details>
+<summary><code>bfs</code> gives helpful errors and warnings.</summary>
+
+For example, `bfs` will detect and suggest corrections for typos:
+
+<pre>
+$ 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` also includes a powerful static analysis to identify likely mistakes:
+
+<pre>
+$ 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>
+</details>
+
+<details>
<summary><code>bfs</code> adds some options that make common tasks easier.</summary>
### `-exclude`