aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xqcd8
1 files changed, 8 insertions, 0 deletions
diff --git a/qcd b/qcd
index 5c5d1aa..a4ee215 100755
--- a/qcd
+++ b/qcd
@@ -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)
;;