Commit 255b0c4f authored by Jeroen Janssens's avatar Jeroen Janssens
Browse files

Mark function asks for confirmation and uses basename of directory when no argument is given

parent 55d4873f
...@@ -13,7 +13,15 @@ jump() { ...@@ -13,7 +13,15 @@ jump() {
} }
mark() { mark() {
mkdir -p "$MARKPATH"; ln -s "$(pwd)" $MARKPATH/$1 DIR="$(pwd)"
if (( $# == 0 )); then
MARK=$(basename $DIR)
else
MARK=$1
fi
if read -q \?"Mark ${DIR} as ${MARK}? (y/n) "; then
mkdir -p "$MARKPATH"; ln -s "${DIR}" "$MARKPATH/$MARK"
fi
} }
unmark() { unmark() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment