diff options
author | pgen <p.gen.progs@gmail.com> | 2019-03-22 23:46:45 +0100 |
---|---|---|
committer | pgen <p.gen.progs@gmail.com> | 2019-03-24 23:53:23 +0100 |
commit | c464effa80ed83d4e146dabd6b8bd6bb9dacb3f9 (patch) | |
tree | 504681deffdf0d2143ef7437b8771b35f79085f1 /examples | |
parent | 31cf4b4f8519186c87ee58b458e21f43f524ea76 (diff) |
Improve the simple_menu example
Diffstat (limited to 'examples')
-rw-r--r-- | examples/simple_menu/README | 2 | ||||
-rw-r--r-- | examples/simple_menu/simple_menu.sh | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/examples/simple_menu/README b/examples/simple_menu/README index 7ee280c..5061976 100644 --- a/examples/simple_menu/README +++ b/examples/simple_menu/README @@ -33,7 +33,7 @@ As usual, 'ENTER' triggers the selection and 'q' quits the menu without outputting anything. To launch the demo, first, make sure to make simple_menu.sh executable -(chmod +x simple_menu.sh) and enter: +(chmod +x simple_menu.sh actions.sh) and enter: ./simple_menu.sh main.mnu ./actions.sh diff --git a/examples/simple_menu/simple_menu.sh b/examples/simple_menu/simple_menu.sh index 827afc8..1d8dd7d 100644 --- a/examples/simple_menu/simple_menu.sh +++ b/examples/simple_menu/simple_menu.sh @@ -102,14 +102,15 @@ function process_menu ITEMS_TO_ADD=1 # By default, only one iteration of the tag is taken # into account - (( ${#TAG} > 10 )) && error "Menu tag too long (max 10 characters)." + (( ${#TAG} > 30 )) \ + && error "Menu tag \"${TAG}\" too long (max 30 characters)." [[ $TAG == --- ]] && VALUE=@@@ [[ $TAG == === ]] && VALUE=@@@ && ITEMS_TO_ADD=COL [[ -z $VALUE ]] && error "Empty menu entry for $TAG" - [[ $TAG == EXIT ]] && TAG="@EXIT@xxxx00" - [[ $TAG == "<"* ]] && TAG="<xxxxxxxxx00" + [[ $TAG == EXIT ]] && TAG="@EXIT@xxxxxxxxxxxxxxxxxxxxxxxx00" + [[ $TAG == "<"* ]] && TAG="<xxxxxxxxxxxxxxxxxxxxxxxxxxxxx00" # Protect quotes in VALUE # """"""""""""""""""""""" @@ -143,7 +144,7 @@ function process_menu $CENTERING \ $ERASE \ -N \ - -F -D o:10 i:0 n:2 \ + -F -D o:30 i:0 n:2 \ -n \ -a m:0/6 \ -m "$TITLE" \ |