aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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'