diff --git a/ethermess.py b/ethermess.py index e7a53a6..73d8362 100644 --- a/ethermess.py +++ b/ethermess.py @@ -162,9 +162,12 @@ def handle_user_command(backend, line): elif command == '/target': default_target_mac = parse_mac(rest) + elif command == '/quit': + return 'quit' + else: # Display usage - print('--- / ; /msg ; /status ; /available; /unavailable; /nick ; /target ') + print('--- / ; /msg ; /status ; /available; /unavailable; /nick ; /target ; /quit') else: # Send message @@ -369,7 +372,9 @@ def eventloop(proc): break line, _, input_buffer = input_buffer.partition(b'\n') - handle_user_command(proc.stdin, line.decode('utf-8')) + if handle_user_command(proc.stdin, line.decode('utf-8')) == 'quit': + writeall(proc.stdin, b'q') + running = False if data == b'': # ^D