feat: support -n to skip openning file

This commit is contained in:
Klesh Wong 2023-02-28 09:39:58 +08:00
parent da48c9946e
commit 06713482b7

10
bin/wl
View File

@ -9,6 +9,12 @@ format_date() {
date -d "$1" +%Y-%m-%d date -d "$1" +%Y-%m-%d
} }
X_OPEN=yes
if [ "$1" = "-n" ]; then
shift
X_OPEN=no
fi
THIS_DATE=$1 THIS_DATE=$1
if [ "$THIS_DATE" -eq "$THIS_DATE" ] 2>/dev/null; then # pure number, enter workday offsetting mode if [ "$THIS_DATE" -eq "$THIS_DATE" ] 2>/dev/null; then # pure number, enter workday offsetting mode
COUNT=$THIS_DATE COUNT=$THIS_DATE
@ -43,5 +49,7 @@ if [ ! -f $LOGPATH ]; then
echo >> $LOGPATH echo >> $LOGPATH
echo $NEXT_DATE >> $LOGPATH echo $NEXT_DATE >> $LOGPATH
fi fi
x-open $LOGPATH if [ "$X_OPEN" = "yes" ]; then
x-open $LOGPATH
fi
#Typora $LOGPATH #Typora $LOGPATH