diff --git a/cd.sh b/cd.sh index 3feee96..c5768e7 100644 --- a/cd.sh +++ b/cd.sh @@ -592,6 +592,16 @@ ${CD_GIT_CHILD} # functions +cd_box_more () { + echo "${CD_BOX_VERTICAL} ${@}" +} +cd_box_open () { + echo "${CD_BOX_DOWN}${CD_BOX_LEFT} ${@}" +} +cd_box_shut () { + echo "${CD_BOX_UP}${CD_BOX_LEFT} ${@}" +} + cd_cat () { if [ "${1}" ] ; then echo "${CD_BOX_DOWN}${CD_BOX_LEFT}$(realpath "${1}")" @@ -644,9 +654,12 @@ local command="${1}" } cd_ls () { - if [ "${1}" ] ; then - echo "${CD_BOX_DOWN}${CD_BOX_LEFT}$(realpath "${1}")" +local path + if [ -d "${1}" ] ; then + path="$(realpath "${1}")" + cd_box_open "${split}" ls -a -l "${1}" || exit + cd_box_shut "${split}" fi }