function __tas_task_idx() { echo "$@" | sed 's/^[> ] \([0-9]\+\)\..\+$/\1/' } function __tas_show() { tas show $(__tas_task_idx "$@") } function __tas_start() { if [[ "$1" != "" ]]; then tas start $(__tas_task_idx "$@") fi } function __tas_remove() { if [[ "$1" != "" ]]; then tas remove $(__tas_task_idx "$@") fi } function __tas_list() { tas list | fzf \ --info=inline --height=50% --no-sort --keep-right --layout=reverse \ --preview="tas show \$(sed 's/^[> ] \\([0-9]\\+\\)\\..\\+$/\\1/' {+f})" } function taz() { case $1 in "" | "show" | "sh") __tas_show "$(__tas_list)" ;; "list" | "ls") __tas_list ;; "start" | "st") __tas_start "$(__tas_list)" ;; "remove" | "rm") __tas_remove "$(__tas_list)" ;; esac }