|
9 | 9 | from . import crypto
|
10 | 10 | from . import logging # noqa: F401
|
11 | 11 |
|
12 |
| -ap = AP(epilog=""" |
| 12 | +ap = AP( |
| 13 | + epilog=""" |
13 | 14 |
|
14 | 15 | Examples:
|
15 | 16 |
|
|
25 | 26 | # List room info:
|
26 | 27 | python3 -msogs -L
|
27 | 28 |
|
28 |
| -""", formatter_class=RawDescriptionHelpFormatter) # noqa: E501 |
| 29 | +""", # noqa: E501 |
| 30 | + formatter_class=RawDescriptionHelpFormatter, |
| 31 | +) |
29 | 32 |
|
30 | 33 | actions = ap.add_mutually_exclusive_group()
|
31 | 34 |
|
|
80 | 83 | actions.add_argument(
|
81 | 84 | '--list-global-mods', '-M', action='store_true', help="List global moderators/admins"
|
82 | 85 | )
|
| 86 | +ap.add_argument( |
| 87 | + "--verbose", "-v", action='store_true', help="Show more information for some commands" |
| 88 | +) |
83 | 89 | ap.add_argument(
|
84 | 90 | "--yes", action='store_true', help="Don't prompt for confirmation for some commands, just do it"
|
85 | 91 | )
|
@@ -109,16 +115,21 @@ def print_room(room: model.Room):
|
109 | 115 | Messages: {msgs} ({msgs_size:.1f} MB)
|
110 | 116 | Attachments: {files} ({files_size:.1f} MB)
|
111 | 117 | Active users: {active[0]} (7d), {active[1]} (14d) {active[2]} (30d)
|
112 |
| -Moderators: {admins} admins ({len(ha)} hidden), {mods} moderators ({len(hm)} hidden):""" |
| 118 | +Moderators: {admins} admins ({len(ha)} hidden), {mods} moderators ({len(hm)} hidden)""", |
| 119 | + end='', |
113 | 120 | )
|
114 |
| - for id in a: |
115 |
| - print(f" - {id} (admin)") |
116 |
| - for id in ha: |
117 |
| - print(f" - {id} (hidden admin)") |
118 |
| - for id in m: |
119 |
| - print(f" - {id} (moderator)") |
120 |
| - for id in hm: |
121 |
| - print(f" - {id} (hidden moderator)") |
| 121 | + if args.verbose and any((m, a, hm, ha)): |
| 122 | + print(":") |
| 123 | + for id in a: |
| 124 | + print(f" - {id} (admin)") |
| 125 | + for id in ha: |
| 126 | + print(f" - {id} (hidden admin)") |
| 127 | + for id in m: |
| 128 | + print(f" - {id} (moderator)") |
| 129 | + for id in hm: |
| 130 | + print(f" - {id} (hidden moderator)") |
| 131 | + else: |
| 132 | + print() |
122 | 133 |
|
123 | 134 |
|
124 | 135 | db.conn = db.sqlite_connect()
|
|
0 commit comments