summarylogtreecommitdiffstats
path: root/rename_todoist_to_todoist_cli.patch
blob: 870756f4660a74d753831d9f9ff7655779bde19b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
diff --git a/todoist_functions.sh b/todoist_functions.sh
index ad4e7ce..b7b1e7a 100644
--- a/todoist_functions.sh
+++ b/todoist_functions.sh
@@ -1,4 +1,4 @@
-select_items_command="todoist --namespace --project-namespace list | peco | cut -d ' ' -f 1 | tr '\n' ' '"
+select_items_command="todoist-cli --namespace --project-namespace list | peco | cut -d ' ' -f 1 | tr '\n' ' '"
 
 function insert-in-buffer () {
     if [ -n "$1" ]; then
@@ -25,7 +25,7 @@ bindkey "^xtt" peco-todoist-item
 
 # todoist find project
 function peco-todoist-project () {
-    local SELECTED_PROJECT="$(todoist --project-namespace projects | peco | head -n1 | cut -d ' ' -f 1)"
+    local SELECTED_PROJECT="$(todoist-cli --project-namespace projects | peco | head -n1 | cut -d ' ' -f 1)"
     insert-in-buffer "${SELECTED_PROJECT}" "-P"
 }
 zle -N peco-todoist-project
@@ -33,7 +33,7 @@ bindkey "^xtp" peco-todoist-project
 
 # todoist find labels
 function peco-todoist-labels () {
-    local SELECTED_LABELS="$(todoist labels | peco | cut -d ' ' -f 1 | tr '\n' ',' | sed -e 's/,$//')"
+    local SELECTED_LABELS="$(todoist-cli labels | peco | cut -d ' ' -f 1 | tr '\n' ',' | sed -e 's/,$//')"
     insert-in-buffer "${SELECTED_LABELS}" "-L"
 }
 zle -N peco-todoist-labels
@@ -58,7 +58,7 @@ bindkey "^xtd" peco-todoist-date
 
 function todoist-exec-with-select-task () {
     if [ -n "$2" ]; then
-        BUFFER="todoist $1 $(echo "$2" | tr '\n' ' ')"
+        BUFFER="todoist-cli $1 $(echo "$2" | tr '\n' ' ')"
         CURSOR=$#BUFFER
         zle accept-line
     fi
diff --git a/todoist_functions_fzf.sh b/todoist_functions_fzf.sh
index b234dd5..9b01e73 100644
--- a/todoist_functions_fzf.sh
+++ b/todoist_functions_fzf.sh
@@ -1,4 +1,4 @@
-select_items_command="todoist --namespace --project-namespace list | fzf | cut -d ' ' -f 1 | tr '\n' ' '"
+select_items_command="todoist-cli --namespace --project-namespace list | fzf | cut -d ' ' -f 1 | tr '\n' ' '"
 
 function insert-in-buffer () {
     if [ -n "$1" ]; then
@@ -25,7 +25,7 @@ bindkey "^xtt" fzf-todoist-item
 
 # todoist find project
 function fzf-todoist-project () {
-    local SELECTED_PROJECT="$(todoist --project-namespace projects | fzf | head -n1 | cut -d ' ' -f 1)"
+    local SELECTED_PROJECT="$(todoist-cli --project-namespace projects | fzf | head -n1 | cut -d ' ' -f 1)"
     insert-in-buffer "${SELECTED_PROJECT}" "-P"
 }
 zle -N fzf-todoist-project
@@ -33,7 +33,7 @@ bindkey "^xtp" fzf-todoist-project
 
 # todoist find labels
 function fzf-todoist-labels () {
-    local SELECTED_LABELS="$(todoist labels | fzf | cut -d ' ' -f 1 | tr '\n' ',' | sed -e 's/,$//')"
+    local SELECTED_LABELS="$(todoist-cli labels | fzf | cut -d ' ' -f 1 | tr '\n' ',' | sed -e 's/,$//')"
     insert-in-buffer "${SELECTED_LABELS}" "-L"
 }
 zle -N fzf-todoist-labels
@@ -58,7 +58,7 @@ bindkey "^xtd" fzf-todoist-date
 
 function todoist-exec-with-select-task () {
     if [ -n "$2" ]; then
-        BUFFER="todoist $1 $(echo "$2" | tr '\n' ' ')"
+        BUFFER="todoist-cli $1 $(echo "$2" | tr '\n' ' ')"
         CURSOR=$#BUFFER
         zle accept-line
     fi
diff --git a/todoist_functions_fzf_bash.sh b/todoist_functions_fzf_bash.sh
index b804b4f..792b20c 100644
--- a/todoist_functions_fzf_bash.sh
+++ b/todoist_functions_fzf_bash.sh
@@ -27,14 +27,14 @@ _todoist() {
 
     for arg in "${COMP_WORDS[@]}"; do
         case "$arg" in
-        todoist)
-            cmd='todoist'
+        todoist-cli)
+            cmd='todoist-cli'
             ;;
         # These are the current commands; not all have completion options,
         # but they're listed here anyway, for the future
         list|show|completed-list|add|modify|close|delete|labels|projects|\
         karma|sync|quick|help)
-            [ "$cmd" == 'todoist' ] && cmd+="__$arg"
+            [ "$cmd" == 'todoist-cli' ] && cmd+="__$arg"
             ;;
         l)
             cmd+='__list'
@@ -74,7 +74,7 @@ _todoist() {
 ' --project-namespace --help -h --version -v '
 
     case "$cmd" in
-    todoist)
+    todoist-cli)
         opts+='list l show completed-list c-l cl add a modify m close c'\
 ' delete d labels projects karma sync s quick q help h'
         ;;
@@ -98,17 +98,17 @@ _todoist() {
             ;;
         --label-ids|-L)
             # shellcheck disable=SC2207
-            COMPREPLY=( $(todoist labels | $fzfcmd --multi | cut -d ' ' -f 1 \
+            COMPREPLY=( $(todoist-cli labels | $fzfcmd --multi | cut -d ' ' -f 1 \
             | paste -d, -s -) )
             return 0
             ;;
         --project-id|-P)
             # shellcheck disable=SC2207
-            COMPREPLY=( $(todoist projects | $fzfcmd | cut -d ' ' -f 1) )
+            COMPREPLY=( $(todoist-cli projects | $fzfcmd | cut -d ' ' -f 1) )
             return 0
             ;;
         --project-name|-N)
-            COMPREPLY=( "'$(todoist projects | $fzfcmd | cut -d ' ' -f 2- \
+            COMPREPLY=( "'$(todoist-cli projects | $fzfcmd | cut -d ' ' -f 2- \
             | cut -b 2- )'" )
             return 0
             ;;
@@ -144,7 +144,7 @@ _todoist() {
         __todoist_debug "fzfcmd=$fzfcmd"
 
         # shellcheck disable=SC2207
-        COMPREPLY=( $(todoist --namespace --project-namespace list \
+        COMPREPLY=( $(todoist-cli --namespace --project-namespace list \
         | $fzfcmd | cut -d ' ' -f 1 | tr -d "'") )
         return 0
     fi
@@ -155,4 +155,4 @@ _todoist() {
     [ -n "$opts" ] && COMPREPLY=( $(compgen -W "$opts" -- "$cur") )
 }
 
-complete -F _todoist todoist
+complete -F _todoist todoist-cli