aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2024-02-01 22:47:37 -0800
committerKaz Kylheku <kaz@kylheku.com>2024-02-01 22:47:37 -0800
commitbe4d728fe35561af37d98e9f51a6e89232a1e53e (patch)
treec8cb6f5ce02c464a67bfe5c9a33eaa8c8cb44068
parentaf4c0df9b25605ceb088cab4c5478ac52df25752 (diff)
downloadcdlog-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.md3
-rw-r--r--cdlog.sh10
2 files changed, 11 insertions, 2 deletions
diff --git a/README.md b/README.md
index f3d4f3b..6b96ef4 100644
--- a/README.md
+++ b/README.md
@@ -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
diff --git a/cdlog.sh b/cdlog.sh
index 0525213..272d42e 100644
--- a/cdlog.sh
+++ b/cdlog.sh
@@ -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'