From b340a5b02ae1d971d66071017886cdd2705ddc32 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Tue, 18 Apr 2023 12:28:22 +0800 Subject: Update --- bin/task/context | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'bin/task') diff --git a/bin/task/context b/bin/task/context index ae78b26..aa32206 100755 --- a/bin/task/context +++ b/bin/task/context @@ -18,12 +18,18 @@ if [[ "$1" =~ ^e ]]; then $EDITOR $LOG_FILE exit 0 elif [[ "$1" =~ ^[a-zA-Z] ]]; then - echo "$1" > ~/.task/context - exit 0 + if [ -z "$2" ]; then + echo "$1" > ~/.task/context + exit 0 + else + context="$1" + time="$2" + fi +else + context="$(cat ~/.task/context)" + time="$1" fi -context="$(cat ~/.task/context)" -time="$1" # The unit of time display. For example: # If it is 900(seconds), then the minimal symbol of -- cgit v1.2.3-70-g09d2