diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2024-02-01 22:47:37 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2024-02-01 22:47:37 -0800 |
commit | be4d728fe35561af37d98e9f51a6e89232a1e53e (patch) | |
tree | c8cb6f5ce02c464a67bfe5c9a33eaa8c8cb44068 | |
parent | af4c0df9b25605ceb088cab4c5478ac52df25752 (diff) | |
download | cdlog-be4d728fe35561af37d98e9f51a6e89232a1e53e.tar.gz cdlog-be4d728fe35561af37d98e9f51a6e89232a1e53e.tar.bz2 cdlog-be4d728fe35561af37d98e9f51a6e89232a1e53e.zip |
cll command to list all nine.
* cdlog.sh (cdlog): Take -l option to print all nine
directories in the FIFO.
(cll): New alias, for cdlog -l.
* README.md: Documented.
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | cdlog.sh | 10 |
2 files changed, 11 insertions, 2 deletions
@@ -34,7 +34,8 @@ directory in the log, and removes that entry from the log. The second most recent directory becomes most recent and so on. * `cdlog` function shows a listing of the four most recent entries in the -log. The `cl` command is an alias for this. +log, or all nine if given the `-l` argument. The `cl` command is an alias for +for `cdlog` with no arguments and `cll` for `cdlog -l`. * The `mcd` and `mcs` are menu-selection-based analogs of `cd` and `mcs`. They print the contents of the FIFO (all nine entries), and you can @@ -107,11 +107,18 @@ cdlog.pop() # Print four recent cdlog entries. cdlog() { - # c5 through c9 are "hidden" printf "1: %s\n" "$c1" printf "2: %s\n" "$c2" printf "3: %s\n" "$c3" printf "4: %s\n" "$c4" + + if [ "${1-}" = "-l" ] ; then + printf "5: %s\n" "$c5" + printf "6: %s\n" "$c6" + printf "7: %s\n" "$c7" + printf "8: %s\n" "$c8" + printf "9: %s\n" "$c9" + fi } # Menu-based cd/cs. @@ -158,6 +165,7 @@ alias cd='cdlog.chdir -P' alias pd='cdlog.pop' alias cs='cdlog.rot' alias cl='cdlog' +alias cll='cdlog -l' alias mcd='cdlog.mcd' alias mcs='cdlog.mcd -s' |