Add /quit
This commit is contained in:
parent
8e7339e3f1
commit
69a799c412
|
@ -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('--- / <message>; /msg <MAC> <message>; /status <MAC>; /available; /unavailable; /nick <nick>; /target <MAC>')
|
||||
print('--- / <message>; /msg <MAC> <message>; /status <MAC>; /available; /unavailable; /nick <nick>; /target <MAC>; /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
|
||||
|
|
Loading…
Reference in New Issue