aboutsummaryrefslogtreecommitdiffstats
path: root/cdlog.sh
diff options
context:
space:
mode:
Diffstat (limited to 'cdlog.sh')
-rw-r--r--cdlog.sh23
1 files changed, 20 insertions, 3 deletions
diff --git a/cdlog.sh b/cdlog.sh
index fc8568f..feebfda 100644
--- a/cdlog.sh
+++ b/cdlog.sh
@@ -437,10 +437,27 @@ cdlog.alias()
{
local def=
- if [ $# -ne 2 ] ; then
- printf "cdlog.alias: two arguments required\n"
+ case $# in
+ ( 0 )
+ cdlog.aliases
+ return $?
+ ;;
+ ( 1 )
+ if [ ${cdlog_alias[$1]+y} ] ; then
+ printf "%s -> %s\n" "$1" "${cdlog_alias[$1]}"
+ return 0
+ else
+ printf "cdlog.alias; %s: not defined\n" "$1"
+ return 1
+ fi
+ ;;
+ ( 2 )
+ ;;
+ ( * )
+ printf "cdlog.alias: one or two arguments required\n"
return 1
- fi
+ ;;
+ esac
if [ -z "$1" ] ; then
printf "cdlog.alias: alias may not be empty\n"