Add /quit
This commit is contained in:
parent
8e7339e3f1
commit
69a799c412
|
@ -162,9 +162,12 @@ def handle_user_command(backend, line):
|
||||||
elif command == '/target':
|
elif command == '/target':
|
||||||
default_target_mac = parse_mac(rest)
|
default_target_mac = parse_mac(rest)
|
||||||
|
|
||||||
|
elif command == '/quit':
|
||||||
|
return 'quit'
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Display usage
|
# 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:
|
else:
|
||||||
# Send message
|
# Send message
|
||||||
|
@ -369,7 +372,9 @@ def eventloop(proc):
|
||||||
break
|
break
|
||||||
|
|
||||||
line, _, input_buffer = input_buffer.partition(b'\n')
|
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'':
|
if data == b'':
|
||||||
# ^D
|
# ^D
|
||||||
|
|
Loading…
Reference in New Issue