diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2023-04-10 20:44:25 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2023-04-10 20:44:25 +0800 |
commit | 18fcaf66d76c6554c007cadef655128ac99dc14f (patch) | |
tree | 7c45df780a8e70d2fccfa6ecb8907b544cbe63a7 /bin | |
parent | ab8aac861dc37ee8f8aa1e719c0e6e3ccff90d01 (diff) |
Update
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/task/context | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/task/context b/bin/task/context index 6e48df3..44193d0 100755 --- a/bin/task/context +++ b/bin/task/context | |||
@@ -8,7 +8,7 @@ | |||
8 | LOG_FILE=~/log/.context && touch $LOG_FILE | 8 | LOG_FILE=~/log/.context && touch $LOG_FILE |
9 | PLAN_FILE=~/log/plan.context.md | 9 | PLAN_FILE=~/log/plan.context.md |
10 | context="$(cat ~/.task/context)" | 10 | context="$(cat ~/.task/context)" |
11 | [[ "$@" =~ '-s' ]] && SET=true && shift | 11 | [[ "$*" =~ '-s' ]] && SET=true && shift |
12 | time="$1" | 12 | time="$1" |
13 | 13 | ||
14 | # The unit of time display. For example: | 14 | # The unit of time display. For example: |
@@ -76,6 +76,8 @@ _print_spend_time() { | |||
76 | # Print context and time I spend | 76 | # Print context and time I spend |
77 | echo -ne "$ctx\t\t" | 77 | echo -ne "$ctx\t\t" |
78 | date -u -d @"$sec" +%H:%M | tr -d '\n' | 78 | date -u -d @"$sec" +%H:%M | tr -d '\n' |
79 | echo -n "/" | ||
80 | date -u -d @"$seconds_of_plan" +%H:%M | tr -d '\n' | ||
79 | 81 | ||
80 | number_of_spend=$(( $sec / $UNIT )) | 82 | number_of_spend=$(( $sec / $UNIT )) |
81 | # Print block of time spend (green) | 83 | # Print block of time spend (green) |