diff options
| author | Hsieh Chin Fan <pham@topo.tw> | 2023-04-18 12:28:22 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <pham@topo.tw> | 2023-04-18 12:28:22 +0800 |
| commit | b340a5b02ae1d971d66071017886cdd2705ddc32 (patch) | |
| tree | 0f351e0ed31d0ceaa3fc74d24245d17d2ac6d1a6 /bin/task/context | |
| parent | 4fb90b0b1bca82113111e7460795f55d02acb0b2 (diff) | |
Update
Diffstat (limited to 'bin/task/context')
| -rwxr-xr-x | bin/task/context | 14 |
1 files changed, 10 insertions, 4 deletions
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 | |||
| 18 | $EDITOR $LOG_FILE | 18 | $EDITOR $LOG_FILE |
| 19 | exit 0 | 19 | exit 0 |
| 20 | elif [[ "$1" =~ ^[a-zA-Z] ]]; then | 20 | elif [[ "$1" =~ ^[a-zA-Z] ]]; then |
| 21 | echo "$1" > ~/.task/context | 21 | if [ -z "$2" ]; then |
| 22 | exit 0 | 22 | echo "$1" > ~/.task/context |
| 23 | exit 0 | ||
| 24 | else | ||
| 25 | context="$1" | ||
| 26 | time="$2" | ||
| 27 | fi | ||
| 28 | else | ||
| 29 | context="$(cat ~/.task/context)" | ||
| 30 | time="$1" | ||
| 23 | fi | 31 | fi |
| 24 | 32 | ||
| 25 | context="$(cat ~/.task/context)" | ||
| 26 | time="$1" | ||
| 27 | 33 | ||
| 28 | # The unit of time display. For example: | 34 | # The unit of time display. For example: |
| 29 | # If it is 900(seconds), then the minimal symbol of | 35 | # If it is 900(seconds), then the minimal symbol of |