Show More
@@ -4,19 +4,22 b' shopt -s extglob' | |||||
4 | { |
|
4 | { | |
5 | "$hg" --debug help 2>/dev/null | \ |
|
5 | "$hg" --debug help 2>/dev/null | \ | |
6 | awk -F', ' '/^list of commands:/ {commands=1} |
|
6 | awk -F', ' '/^list of commands:/ {commands=1} | |
7 | commands && /^ [^ ]/ { |
|
7 | commands==1 && /^ [^ ]/ { | |
8 | sub(/ /, "") |
|
8 | line = substr($0, 2) | |
9 | sub(/:.*/, "") |
|
9 | colon = index(line, ":") | |
10 | command = $1 |
|
10 | if (colon > 0) | |
|
11 | line = substr(line, 1, colon-1) | |||
|
12 | n = split(line, aliases) | |||
|
13 | command = aliases[1] | |||
11 | if (index(command, "debug") == 1) { |
|
14 | if (index(command, "debug") == 1) { | |
12 |
for (i=1; i<= |
|
15 | for (i=1; i<=n; i++) | |
13 |
debug[j++] = |
|
16 | debug[j++] = aliases[i] | |
14 | next |
|
17 | next | |
15 | } |
|
18 | } | |
16 | print command |
|
19 | print command | |
17 |
for (i=2; i<= |
|
20 | for (i=2; i<=n; i++) | |
18 |
if (index(command, |
|
21 | if (index(command, aliases[i]) != 1) | |
19 |
print |
|
22 | print aliases[i] | |
20 | } |
|
23 | } | |
21 | /^global options:/ {exit 0} |
|
24 | /^global options:/ {exit 0} | |
22 | END {for (i in debug) print debug[i]}' |
|
25 | END {for (i in debug) print debug[i]}' |
General Comments 0
You need to be logged in to leave comments.
Login now