From f83abc1937be917df995573248e1ef6d14c80130 Mon Sep 17 00:00:00 2001 From: "hyunsik.noh" Date: Tue, 8 Oct 2013 18:07:57 +0900 Subject: [PATCH] [Title]bashscript for auto completion --- tizen | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tizen diff --git a/tizen b/tizen new file mode 100644 index 0000000..a8f9a0d --- /dev/null +++ b/tizen @@ -0,0 +1,25 @@ +#Should be fix binary name and path before to test this. +#1. move this file to /etc/bash_completion.d +#2. execute ". /etc/bash_completion" +#3. test after "tizen" command +_tizen() +{ + local cur prev args + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + args="" + + for ((i=0; i < ${COMP_CWORD} ; i++)) + do + args="${args} ${COMP_WORDS[i]}" + done + + next=$(java -cp /home/hyunsik/workspace_pde_develop/test/bin TizenAutoComplete "${args}") + COMPREPLY=($(compgen -W "${next}" -- ${cur})) + + return 0 + +} + +complete -F _tizen tizen -- 2.7.4