-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathREADME
More file actions
55 lines (48 loc) · 1.39 KB
/
README
File metadata and controls
55 lines (48 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
CLI FRAMEWORK
CLI Framework is a basic command line interface framework containing methods for layout.
instant_gets()
Take one key as feedback without pressing Enter
----- @menu_choice = instant_gets
indent()
Indent content x number of spaces
Pass in your line of content as the first argument
Optional: pass in number of space to indent by
Change 43 to something else to change default
----- indent("Main Menu", 20)
blank_indent()
Indent line without line break
Useful in conjunction with instant_gets (needs to be 1 space more than regular indent for this)
----- indent("Main Menu", 20)
----- blanck_indent(21)
----- instant_gets
br()
Line break
Optional: pass in number of line breaks
----- indent("Main Menu", 20)
----- br(2)
----- blanck_indent(21)
----- instant_gets
hr()
Horizontal rule
Optional: pass in "=" for double line instead of single
----- hr(=)
----- indent("Main Menu", 20)
----- br(2)
----- blanck_indent(21)
----- instant_gets
invalid_command()
Invalid command warning
Uses br and indent to format
Useful for menus in conjunction with case statements/until loops
----- until menu_choice = "q"
----- case menu_choice
----- when "1"
----- some_action
----- when "2"
----- some_other_action
----- when "q"
----- menu_choice
----- else
----- invalid_command
----- end
----- end