Browse Source

update readme and examples

Daniel Sheffield 2 months ago
parent
commit
95a984a5b0
2 changed files with 17 additions and 1 deletions
  1. 11 0
      README.md
  2. 6 1
      recall.sh

+ 11 - 0
README.md

@@ -23,6 +23,12 @@ Now I want to test my grep...
 recall find | grep 'pattern' # no-need to run find again, only need the output
 ```
 
+Original find command had non-zero exit status due to partial failures...
+
+```bash
+recall -z find | if [ "$?" == "0" ]; then grep 'pattern'; fi  # suppress error
+```
+
 With aliases in `.zshrc` and `.shrc`...
 
 ```bash
@@ -46,3 +52,8 @@ I want to see all the captured commands...
 ```bash
 @ -l
 ```
+
+I want to see only the last 30 captured `find` commands...
+```bash
+@ -l -n 30 find
+```

+ 6 - 1
recall.sh

@@ -19,10 +19,15 @@ the captured exit status.
   usage: "${0##*/} [ -l ] [ -n NUM ] PROG [ ARGS ... ]
 
   examples:
-    - Print the output of last captured find command
+    - Print the output of last captured find command and exit with captured
+      exit status
 
       ${0##*/} find
 
+    - Print the output of last captured find command and exit with success
+
+      ${0##*/} -z find
+
     - List paths to all captured commands
 
       ${0##*/} -l