diff options
| author | Hsieh Chin Fan <pham@topo.tw> | 2023-04-14 10:07:39 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <pham@topo.tw> | 2023-04-14 10:07:39 +0800 |
| commit | bca6ed08439a6b106b21bc37634b75a9fe6ab9cb (patch) | |
| tree | d9cc762b36b761c0a59d4cc62905c9dd352fe463 | |
| parent | 00d2bfc1d73bc9526b23d7c95c8331dbf9528dbd (diff) | |
tkc -> context
| -rwxr-xr-x | bin/task/context | 4 | ||||
| -rw-r--r-- | bin/task/shellrc | 1 | ||||
| -rw-r--r-- | zsh/_context.zsh (renamed from zsh/_tkc.zsh) | 6 |
3 files changed, 7 insertions, 4 deletions
diff --git a/bin/task/context b/bin/task/context index 06848d6..639f54a 100755 --- a/bin/task/context +++ b/bin/task/context | |||
| @@ -16,6 +16,10 @@ PROC=$$ | |||
| 16 | 16 | ||
| 17 | context="$(cat ~/.task/context)" | 17 | context="$(cat ~/.task/context)" |
| 18 | [[ "$*" =~ '-s' ]] && SET=true && shift | 18 | [[ "$*" =~ '-s' ]] && SET=true && shift |
| 19 | [[ "$1" =~ ^[a-zA-Z] ]] && { | ||
| 20 | echo "$1" > ~/.task/context | ||
| 21 | exit 0 | ||
| 22 | } | ||
| 19 | time="$1" | 23 | time="$1" |
| 20 | 24 | ||
| 21 | # The unit of time display. For example: | 25 | # The unit of time display. For example: |
diff --git a/bin/task/shellrc b/bin/task/shellrc index 7098ac0..6d7f109 100644 --- a/bin/task/shellrc +++ b/bin/task/shellrc | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | # task | 1 | # task |
| 2 | alias c='context' | 2 | alias c='context' |
| 3 | tk() { task rc.context=`cat ~/.task/context` $@; } | 3 | tk() { task rc.context=`cat ~/.task/context` $@; } |
| 4 | tkc(){ echo $1 >~/.task/context; } | ||
| 5 | alias tkcc='task context' | 4 | alias tkcc='task context' |
| 6 | tkcn() { echo none >~/.task/context; } | 5 | tkcn() { echo none >~/.task/context; } |
| 7 | tkcp() { echo plan >~/.task/context; } | 6 | tkcp() { echo plan >~/.task/context; } |
diff --git a/zsh/_tkc.zsh b/zsh/_context.zsh index 2e98d4f..dbb250d 100644 --- a/zsh/_tkc.zsh +++ b/zsh/_context.zsh | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #compdef tkc | 1 | #compdef context |
| 2 | 2 | ||
| 3 | function _tkc() { | 3 | function _context() { |
| 4 | compadd -S '' $(sed -E '/^$/q' ~/log/plan.context.md | cut -d' ' -f1) | 4 | compadd -S '' $(sed -E '/^$/q' ~/log/plan.context.md | cut -d' ' -f1) |
| 5 | } | 5 | } |
| 6 | 6 | ||
| 7 | _tkc | 7 | _context |