summarylogtreecommitdiffstats
path: root/rename_todoist_to_todoist_cli.patch
diff options
context:
space:
mode:
authorMaksim Novikov2022-04-10 16:26:55 +0200
committerMaksim Novikov2022-04-10 16:26:55 +0200
commit6935763aa3a0b289b94af2dfd1de11f71a103a0d (patch)
treea1b0d03d1bb080e262e0a8daca6edbad9af4176c /rename_todoist_to_todoist_cli.patch
parent12902efe07ccdde9a2049a437634a4c8107ff88d (diff)
downloadaur-todoist-git.tar.gz
Rename binary to todoist-cli due to conflict with todoist-appimage
Diffstat (limited to 'rename_todoist_to_todoist_cli.patch')
-rw-r--r--rename_todoist_to_todoist_cli.patch141
1 files changed, 141 insertions, 0 deletions
diff --git a/rename_todoist_to_todoist_cli.patch b/rename_todoist_to_todoist_cli.patch
new file mode 100644
index 000000000000..870756f4660a
--- /dev/null
+++ b/rename_todoist_to_todoist_cli.patch
@@ -0,0 +1,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