add ecoli_editline and enhance yaml parser
[protos/libecoli.git] / test-completion.sh
diff --git a/test-completion.sh b/test-completion.sh
new file mode 100644 (file)
index 0000000..e1d1b31
--- /dev/null
@@ -0,0 +1,18 @@
+
+# complete -F _parser_options dummy_command
+
+_parser_options()
+{
+       local curr_arg
+       local i
+
+       curr_arg=${COMP_WORDS[COMP_CWORD]}
+
+       # remove the command name, only keep args
+       words=( "${COMP_WORDS[@]}" )
+       unset words[0]
+
+       IFS=$'\n' read -d '' -r -a COMPREPLY <<- EOF
+       $(./build/parse-yaml --complete -i examples/yaml/test.yaml -o pipo -- "${words[@]}")
+       EOF
+}