-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathadmin.awk
executable file
·61 lines (61 loc) · 1.23 KB
/
admin.awk
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
#!/usr/bin/awk -f
#
# by Dirk Meyer (dinoex)
# Copyright (C) 2004-2021 Dirk Meyer
#
# By using this file, you agree to the terms and conditions set
# forth in the GNU General Public License. More information is
# available in the LICENSE file.
#
# If you received this file without documentation, it can be
# downloaded from https://iroffer.net/
#
# SPDX-FileCopyrightText: 2007-2021 Dirk Meyer
# SPDX-License-Identifier: GPL-2.0-only
#
# $Id$
#
BEGIN {
FS = "\""
LAST = 0
}
END {
print "** For additional help, see the documentation at https://iroffer.net/"
}
/^{[0-9]/{
LEVEL = substr( $0, 2, 1 )
if ( LEVEL != LAST ) {
LAST = LEVEL
M = "<Unknown>"
if ( LEVEL == "1" )
M = "Info"
if ( LEVEL == "2" )
M = "Transfer"
if ( LEVEL == "3" )
M = "Pack"
if ( LEVEL == "4" )
M = "File"
if ( LEVEL == "5" )
M = "Misc"
if ( LEVEL == "6" )
M = "Bot"
printf( "** -- %s Commands --\n", M )
}
if ( NF == 7 ) {
printf( "** %-20s : %s\n", $2 " " $4, $6 )
next
}
if ( NF == 5 ) {
printf( "** %-20s : %s\n", $2, $4 )
next
}
if ( NF == 13 ) {
MORE = $6 "\"" $7 "\"" $8 "\"" $9 "\"" $10 "\"" $11 "\"" $12
gsub( "\\\\", "", MORE )
printf( "** %-20s : %s\n", $2 " " $4, MORE )
next
}
print
print NF
}
# eof