handle default (help) case before creating message object

This commit is contained in:
chiptune 2023-12-08 08:34:13 -06:00
parent ec41d8b4e6
commit 1928a64e4a
1 changed files with 3 additions and 3 deletions

View File

@ -496,9 +496,7 @@ if __name__ == "__main__":
parser.add_argument("-r", "--reply", help="reply to topic N", metavar='N', nargs=1, type=lambda x: int(x) if int(x) > 0 else False)
parser.add_argument("-e", "--edit", help="edit topic number `X` or message number M`X`", metavar='X', nargs=1, type=lambda x: int(x) if x.isnumeric() else x)
parser.add_argument("--mark-all-read", help="(broken) mark all topics as read", action="store_true")
args = parser.parse_args()
parser.add_argument("--mark-all-read", help="mark all topics as read", action="store_true")
# default behaviour: print help text
if not len(sys.argv) > 1:
@ -507,6 +505,8 @@ if __name__ == "__main__":
messages = Messages()
args = parser.parse_args()
if args.unread:
topics = messages.unread_topics()
if len(topics) == 0: