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