ChatMasterMind Application Refactor and Enhancement #8

Merged
juk0de merged 122 commits from restructurings into main 2023-09-12 07:36:07 +02:00
Showing only changes of commit 54ece6efeb - Show all commits

View File

@ -13,7 +13,15 @@ def print_cmd(args: argparse.Namespace, config: Config) -> None:
try:
message = Message.from_file(fname)
if message:
print(message.to_str(source_code_only=args.source_code_only))
if args.question:
print(message.question)
elif args.answer:
print(message.answer)
elif message.answer and args.only_source_code:
for code in message.answer.source_code():
print(code)
else:
print(message.to_str())
except MessageError:
print(f"File is not a valid message: {args.file}")
sys.exit(1)