From d9b4950e8e42ac6a608457d3903817a5560107bd Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 16 Nov 2022 14:58:31 -0500 Subject: README: Use `console` syntax highlighting more --- README.md | 55 +++++++++++++++++++++++++++++++++---------------------- 1 file 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 `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. -
-$ find haystack
+
+
+
+
+
+
+
+
+
bfsfind
+ +```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 -haystack/shallow/needle - +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. + -
-$ bfs haystack
+```console
+$ bfs haystack
 haystack
 haystack/deep
 haystack/shallow
 haystack/deep/1
-haystack/shallow/needle
-haystack/deep/1/2
-haystack/deep/1/2/3
-haystack/deep/1/2/3/4
+haystack/shallow/needle
 ...
-
+``` + +
@@ -154,21 +164,22 @@ haystack/needle For example, `bfs` will detect and suggest corrections for typos: -
+```console
 $ bfs -nam needle
-bfs: error: bfs -nam needle
-bfs: error:     ~~~~
-bfs: error: Unknown argument; did you mean -name?
-
+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: -
+```console
 $ bfs -print -name 'needle'
-bfs: warning: bfs -print -name needle
-bfs: warning:            ~~~~~~~~~~~~
-bfs: warning: The result of this expression is ignored.
-
+bfs: warning: bfs -print -name needle +bfs: warning: ~~~~~~~~~~~~ +bfs: warning: The result of this expression is ignored. +``` +
-- cgit v1.2.3