-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathrebar3.sh
34 lines (31 loc) · 939 Bytes
/
rebar3.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
_patch_help() {
if [[ "$*" == "rebar3" ]]; then
$1 --help 2>&1 | gawk '{
if (match($0, /Several tasks are available:$/)) {
commandZone = 1
print "Commands:"
} else {
if (commandZone) {
if (match($0, /^\S/)) {
if (match($0, /^Run /)) {
} else if (match($0, / <task>:$/)) {
print " " substr($0, 0, RSTART)
} else {
print " " $0
}
}
} else {
print $0
}
}
}'
else
_patch_help_run_help_subcmd $@ | \
sed \
-e 's/^.*<task>:$/Commands:/' \
-e 's/\[{\|}\]//g' \
fi
}
_patch_table() {
_patch_table_edit_arguments ';;' | sed 's/ # \[.*\]$//'
}