Skip to content

Commit

Permalink
Don't assume database location in bash completion
Browse files Browse the repository at this point in the history
Instead let timetrap decide its location based on settings.
  • Loading branch information
categulario committed Nov 9, 2020
1 parent 517a23d commit f5776cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion completions/bash/timetrap-autocomplete.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ _timetrap ()
{
cur="${COMP_WORDS[COMP_CWORD]}"
cmd="${COMP_WORDS[1]}"

if [[ ( $cmd = s* || $cmd = d* ) && "$COMP_CWORD" = 2 ]]; then
COMPREPLY=($(compgen -W "$(echo "select distinct sheet from entries where sheet not like '\_%';" | sqlite3 ~/.timetrap.db)" $cur))
COMPREPLY=($(compgen -W "$(echo "select distinct sheet from entries where sheet not like '\_%';" | t b)" $cur))
return
elif [[ "$COMP_CWORD" = 1 ]]; then
CMDS="archive backend configure display edit in kill list now out resume sheet week month"
Expand Down

0 comments on commit f5776cf

Please sign in to comment.