diff options
Diffstat (limited to 'cdlog.sh')
-rw-r--r-- | cdlog.sh | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -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" |