diff options
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | cdlog.sh | 10 |
2 files changed, 11 insertions, 2 deletions
@@ -53,7 +53,8 @@ that point to the bottom. * The `cdr` command is used for recovering previous sessions. It presents you with a numbered list of these sessions. You can recover to one of the sessions, use a `c` prefix on the number to clone the session into -the current session, or press Enter to do nothing. +the current session, or press Enter to do nothing. Deleting unwanted +sessions is possible with a `d` prefix. * The `cdalias` command is used for defining "cd aliases"; see below. @@ -108,7 +108,9 @@ cdlog.recover() if [ $i -eq 1 ] ; then printf "Use 1 to select context, c1 to clone,\n" else - printf "Use 1-%s to select context, c1-c%s to clone,\n" $i $i + printf "Use 1-%s to select context,\n" $i + printf "c1-c%s to clone,\n" $i + printf "d1-d%s to delete,\n" $i fi printf "or Enter to keep current context: " read sel @@ -127,6 +129,12 @@ cdlog.recover() break fi ;; + ( d[1-9] ) + sel=$(cdlog.get_param ${sel#d} "$@") + if [ -n "$sel" ] ; then + rm "$sel" && printf "Deleted!\n" + fi + ;; ( "" ) break ;; |