5 parse_yaml=ecoli-parse-yaml
6 libecoli=/usr/share/libecoli/ecoli.sh
11 This example demonstrates how to build an interactive command
12 line in a shell script, using a description in yaml format.
14 Usage: $0 [options...] [tests...]
18 path to ecoli-parse-yaml binary (default is to search
21 path to libecoli.sh library (default is $libecoli)
26 while getopts "hp:l:" opt; do
41 if ! command -v $parse_yaml > /dev/null 2> /dev/null && \
42 ! readlink -e $parse_yaml > /dev/null 2> /dev/null; then
43 echo "Cannot find ecoli-parse-yaml ($parse_yaml)"
46 if ! readlink -e $libecoli > /dev/null 2> /dev/null; then
47 echo "Cannot find libecoli.sh ($libecoli)"
59 help: Say hello to someone
65 help: Name of the person to greet
73 help: Say good bye to someone
81 help: Name of the person to greet
91 $parse_yaml -i $yaml -o $output || match=0
92 if [ "$match" = "1" ]; then
95 name=$(ec_pnode_get_str $(ec_pnode_find_first ec_node1 name) 0)
96 hello=$(ec_pnode_get_str $(ec_pnode_find_first ec_node1 hello) 0)
98 if [ "$hello" != "" ]; then
99 echo "$name says hello to you!"
101 echo "$name says good bye to you!"