Change listnotes listing style
Rewrote the listnotes command and changed its listing style.
This commit is contained in:
parent
74c5fc79f1
commit
cb61e38aa0
1 changed files with 35 additions and 15 deletions
|
@ -6,20 +6,40 @@ in /docs/github/ for its full text.
|
|||
info
|
||||
|
||||
function listnotes() {
|
||||
case $1 in -d|--dynamic )
|
||||
. ~/.shellnotes/util/listnotes/d/d.sh
|
||||
esac
|
||||
case $1 in -n|--number )
|
||||
. ~/.shellnotes/util/listnotes/n/n.sh
|
||||
esac
|
||||
case $1 in -f|--folder )
|
||||
. ~/.shellnotes/util/listnotes/f/f.sh
|
||||
esac
|
||||
if [[ "$1" == "" ]]; then
|
||||
if [ -z "$(ls -A $DEFAULT_PATH)" ]; then
|
||||
echo "Your Notes folder is empty."
|
||||
else
|
||||
ls $DEFAULT_PATH -t
|
||||
|
||||
listnotesFunc () {
|
||||
|
||||
NOTES="`ls $DEFAULT_PATH --color=always `"
|
||||
|
||||
if [ "$NOTES" ]
|
||||
then
|
||||
echo "Your notes from ${DEFAULT_PATH}:\n"
|
||||
echo "$NOTES\
|
||||
|
||||
"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
case $1 in
|
||||
-d|--dynamic)
|
||||
. ~/.shellnotes/util/listnotes/d/d.sh
|
||||
;;
|
||||
-n|--number )
|
||||
. ~/.shellnotes/util/listnotes/n/n.sh
|
||||
;;
|
||||
-f|--folder )
|
||||
. ~/.shellnotes/util/listnotes/f/f.sh
|
||||
;;
|
||||
*)
|
||||
if [ -z $1 ]; then
|
||||
if [ -z "$(ls -A $DEFAULT_PATH)" ]; then
|
||||
echo "Your Notes folder is empty."
|
||||
else
|
||||
listnotesFunc
|
||||
fi
|
||||
else
|
||||
echo "Invalid parameter."
|
||||
fi
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue