forked from raidzero/RZrecovery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui_commands.sh
111 lines (96 loc) · 1.56 KB
/
ui_commands.sh
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#! /sbin/sh
ui_print() {
echo "* print $*"
}
ui_print_n() {
echo "* printn $*"
}
headers() {
echo "* headers $#"
while [ $# -gt 0 ]; do
echo "* header $1"
shift
done
}
items() {
echo "* items $#"
while [ $# -gt 0 ]; do
echo "* item $1"
shift
done
}
show_menu() {
echo "* show_menu"
}
ptotal() {
echo "* ptotal $1"
}
pcur() {
echo "* pcur $1"
}
check_items() {
echo "* check_items $#"
while [ $# -gt 0 ]; do
echo "* check_item $1"
shift
done
}
show_check_menu() {
echo "* show_check_menu"
}
ui_show_indeterminate_progress() {
echo "* show_indeterminate_progress"
}
ui_reset_progress() {
echo "* reset_progress"
}
menu() {
local H=0
local I=0
OPTIND=1
while getopts "h:i:v:" opt; do
if [ "$opt" == "h" ]; then
let H=$H+1
fi
if [ "$opt" == "i" ]; then
let I=$I+1
fi
done
echo "* headers $H"
echo "* items $I"
OPTIND=1
while getopts "h:i:" opt; do
if [ "$opt" == "h" ]; then
echo "* header $OPTARG"
fi
if [ "$opt" == "i" ]; then
echo "* item $OPTARG"
fi
done
echo "* show_menu"
}
check_menu() {
local H=0
local I=0
OPTIND=1
while getopts "h:i:" opt; do
if [ "$opt" == "h" ]; then
let H=$H+1
fi
if [ "$opt" == "i" ]; then
let I=$I+1
fi
done
echo "* headers $H"
echo "* check_items $I"
OPTIND=1
while getopts "h:i:" opt; do
if [ "$opt" == "h" ]; then
echo "* header $OPTARG"
fi
if [ "$opt" == "i" ]; then
echo "* check_item $OPTARG"
fi
done
echo "* show_check_menu"
}