-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathapk.sh
50 lines (43 loc) · 1.17 KB
/
apk.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
_patch_help() {
if [[ "$*" == "apk cache"* ]]; then
cat <<-'EOF' | _patch_help_embed_help $@
# cache% --
## clean - Removing older packages
## download [DEPENDENCY...] - Download missing packages
## sync [DEPENDENCY...] - Delete and download in one step
EOF
if [[ "$*" == "apk cache" ]]; then
$@ --help
fi
else
$@ --help
fi
}
_patch_table() {
if [[ "$*" == "apk add" ]] \
|| [[ "$*" == "apk info" ]] \
|| [[ "$*" == "apk dot" ]] \
|| [[ "$*" == "apk policy" ]] \
|| [[ "$*" == "apk index" ]] \
|| [[ "$*" == "apk fetch" ]] \
; then
_patch_table_edit_arguments 'packages;[`_choice_package`]'
elif [[ "$*" == "apk del" ]] \
|| [[ "$*" == "apk fix" ]] \
|| [[ "$*" == "apk upgrade" ]] \
|| [[ "$*" == "apk manifest" ]] \
|| [[ "$*" == "apk version" ]] \
; then
_patch_table_edit_arguments 'packages;[`_choice_installed_package`]'
elif [[ "$*" == "apk cache"* ]]; then
_patch_table_edit_arguments 'dependency;[`_choice_package`]'
else
cat
fi
}
_choice_installed_package() {
apk info -q
}
_choice_package() {
apk search -q
}