diff options
| -rwxr-xr-x | qcd | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -22,6 +22,10 @@ Usage: __EOF__ } +function absolute_path () { + (cd "$(dirname '$1')" &>/dev/null && printf "%s/%s" "$PWD" "${1##*/}") +} + function qcd () { if [[ $# < 1 ]]; then print_usage @@ -32,6 +36,10 @@ function qcd () { case $command in -a) + local shortcut=$2 + local path=$3 + + echo "${shortcut} $(absolute_path ${path})" >> $QCD_DATABASE_FILE ;; -c) ;; |
