This is the whole Menus folder from RedApple copied to the Duracell USB key on 13oct.2011
Apologies first. This is my first GitHub project. It ia a learning curve that i’ve found to be rather steep. Please bear with me or better yet, send suggestions.
This upload is the initial preview of a little menu system that’s written as a groovy testbed with some java source thrown in.
It is based on the menu systems we have on IBM iSeries mainframes. It uses function keys rather than a mouse. It mimics the 5250 green screen we typically find on older IBM kit.
It is NOT a bash shell. It does not hold state across commands. You cannot change directories unless that is done before Menus starts. You cannot use the bash shell expansion characters like * to gain a full list of matching objects. So something like 'ls -al *.java' will NOT filter your list of files. It just reports the file *.java is not found.
. F1 - Help . F2 - Toggles ability to copy text from console message output at bottom of display. . F3 - End menus and exit . F5 - Refresh current menu, for example if you change the menu text file outside the menu system and want to reload the updated menu. . F9 - Recall prior command on command line - similar to up arrow key in bash shell. . F10 & F12 - backstep key; use this to return to a prior menu level above the current level. Both keys do the same as some keyboards may not have an F12 key.
Menus are normal text files created with a simple text editor. Each menu entry is placed on a single line of the text fileand each line ends with a cr/lf signal character set. These files are placed into the ./data sub-folder of the menu directory.
A menu entry is composed of two parts divide by the := separator. Text to the left of the := appears on the menu entry, while text on the right of the := is treated as a command string to be executed. How is the command string executed ? Each menu entry is assigned a number when it is displayed. So by keying that number of the command line, the command text for the matching entry is executed.
For example, if we have a text file like abc.txt containing lines like :
What is the current PATH variable:=echo $PATH Display the Java Compiler Version:=javac -version Display A Menu of Network Commands:=go network
. What is the current PATH variable . Display the Java Compiler Version . Display A Menu of Network Commands
Enter menu # or command : __
with the text cursor focused on the underline text entry field. If we key the number 2 and press the enter key, a sub-process is started with the command 'javac -version' and results from the standard and error output streams returns to, and is displayed in the audit trail, seen below the area holding menu choices.
There are also several builtin commands within the menu system. Only the 'go' command is covered here. This 'builtin' command loads the menu choices from another text file found in the same ./data directory. In the above example, keying the number 3 plus the enter key, asks the menu system to look for and if possible, load another set of menu choices from ./data/network.txt
It’s all like a short-hand way to key a single number plus enter key to cause a system action, rather than typing or re-typing over and over again any long and/or complex commands. Two keystrokes rather than 30 or 40 keystrokes. Saves time.
Continuing with this example, assume we are now looking at the set of network menu entries. The F10 and F12 function keys can be used as a backstep feature to return to the prior menu that was seen before the network menu, or abc.txt in this case. There is no limit to menu depth, so we could have main menu call network menu call wireless menu to reach a menu item there. Once completed, the F12 or F10 key can be used to walk back thru previous menus. There is no difference between F10 and F12. Both behave identically.
The F9 function key works in the same way to walk back thru each of the prior commands entered. It mimics the bash shell up arrow feature to recall previous commands. When the command is visible on the command line, it can be changed if necessary and the enter key will cause that command to execute.