Skip to content

Commit

Permalink
Add bash completion
Browse files Browse the repository at this point in the history
  • Loading branch information
alexheretic committed Apr 11, 2018
1 parent 1ff2907 commit 668d93f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions completion/bash/aurto
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
## bash completion for aurto

_aurto() {
COMPREPLY=()
local cur="${COMP_WORDS[COMP_CWORD]}"
local prev="${COMP_WORDS[COMP_CWORD-1]}"
if [[ $prev == 'aurto' ]]; then
mapfile -t COMPREPLY < <(compgen -W 'add remove addpkg' -- "$cur")
return 0
fi
}
complete -F _aurto aurto
2 changes: 2 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ all:
@install -D lib/aurto/* -t target$(PREFIX)/lib/aurto
@install -D timer/* -t target$(PREFIX)/lib/systemd/system

@install -D completion/bash/aurto target$(PREFIX)/share/bash-completion/completions/aurto

@if command -v tree >/dev/null 2>&1; then tree target; fi

0 comments on commit 668d93f

Please sign in to comment.