Skip to content

Commit

Permalink
adds bash completion
Browse files Browse the repository at this point in the history
fixes #2
  • Loading branch information
wookietreiber committed May 28, 2017
1 parent 39ce8e8 commit a05ad50
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
31 changes: 31 additions & 0 deletions bash-completion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# bash completion for strace-analyzer

_strace-analyzer()
{
local cur prev
_init_completion || return

case $prev in
summary|read|write|io)
_expand || return 0
compopt -o filenames
COMPREPLY=( $( compgen -fd -- "$cur" ) )
return 0
;;
esac

case $cur in
--*)
COMPREPLY=( $( compgen -W '--help --version' -- $cur ) )
;;
-*)
COMPREPLY=( $( compgen -W '-? -h -help -version --help --version' -- $cur ) )
;;
*)
COMPREPLY=( $( compgen -W 'summary read write io' -- $cur ) )
;;
esac

return 0
} &&
complete -F _strace-analyzer strace-analyzer
4 changes: 3 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ lazy val root = (project in file(".")).
val license = file("LICENSE")
val notice = file("NOTICE.md")
val manPage = file("strace-analyzer.1")
val completion = file("bash-completion.sh")
Seq (
license -> ("share/" + name + "/LICENSE"),
notice -> ("share/" + name + "/NOTICE.md"),
manPage -> ("share/man/man1/" + manPage)
manPage -> ("share/man/man1/" + manPage),
completion -> ("share/bash-completion/completions/" + name)
)
}
)

0 comments on commit a05ad50

Please sign in to comment.