Sha256: c2f37d0046ba7fec702fe161ea50e31e56bb5449132952b51de5f07f27c57810
Contents?: true
Size: 1.08 KB
Versions: 22
Compression:
Stored size: 1.08 KB
Contents
MENU OBJECT TYPE NAME: menu SHORTCUT: menu DESCRIPTION A CLI menu. This can be used for the main loop of a CLI application. CHILDREN prompt - string - '> ' The shortcut may be used to select the menu item. items - container A textual description of the menu item action. loop - boolean The script that will be run if the menu item is selected. default - script Optional script element. Run this if no other option selected. MESSAGES run - Show the options and the the prompt. Then run the script for the user's selection. Optionally repeat as long as the loop child is true. EXAMPLE menu [menu] : on_load [script] : run menu prompt [string] : > loop [bool] : true items [can] : hw [mitem] : shortcut [str] : hw description [str] : Run Hello World do [script] : show 'Hello World!' q [mitem] : shortcut [str] : q description [str] : Quit this menu do [script] : put false into menu.loop SEE ALSO menu_item
Version data entries
22 entries across 22 versions & 2 rubygems