1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-25 15:20:08 +00:00

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

This commit is contained in:
Jeroen Janssens 2013-09-06 09:55:43 -04:00
parent 55d4873f91
commit 255b0c4f5e

View file

@ -13,7 +13,15 @@ jump() {
}
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() {