diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2024-03-14 21:41:27 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2024-03-14 21:41:27 -0700 |
commit | 5f1605f8cc791ac2fe3700484ae9ebf92db47f73 (patch) | |
tree | 8c410ba0901a0b50e7769068cb6a221ded25901c | |
parent | 6de647b88df2d25e80e9016c5a9e75122488e7d0 (diff) | |
download | cdlog-5f1605f8cc791ac2fe3700484ae9ebf92db47f73.tar.gz cdlog-5f1605f8cc791ac2fe3700484ae9ebf92db47f73.tar.bz2 cdlog-5f1605f8cc791ac2fe3700484ae9ebf92db47f73.zip |
cdr: indicate the current context.
* cdlog.sh (cdlog.recover): Indicate the current context
with the string [current].
-rw-r--r-- | cdlog.sh | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -90,7 +90,7 @@ cdlog.init() cdlog.recover() { - local dir + local dirs local i local sel @@ -99,9 +99,11 @@ cdlog.recover() if [ $# -gt 0 -a $1 != ~/.cdlog.'*'.dirs ] ; then printf "These cdlog contexts exist:\n" i=0 - for dir in "$@"; do - printf "[%d]: %s\n" $((++i)) "$(date -r "$dir")" - sed -e '/^$/d' "$dir" | head -9 + for dirs in "$@"; do + printf "[%d]: %s%s\n" $((++i)) \ + "$([ "$dirs" = "$cdlog_dirs" ] && printf "[current] ")" \ + "$(date -r "$dirs")" + sed -e '/^$/d' "$dirs" | head -9 done while true; do |