2022-06-16 10:23:11 +09:00
|
|
|
# SPDX-FileCopyrightText: 2022 n9k <https://git.076.ne.jp/ninya9k>
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
2022-06-15 14:39:54 +09:00
|
|
|
from anonstream.control.spec.common import Str, End
|
2022-06-16 10:05:18 +09:00
|
|
|
from anonstream.control.exceptions import ControlSocketExit
|
2022-06-15 14:39:54 +09:00
|
|
|
|
2022-08-01 08:09:52 +09:00
|
|
|
async def cmd_quit():
|
2022-06-16 10:05:18 +09:00
|
|
|
raise ControlSocketExit
|
2022-06-15 14:39:54 +09:00
|
|
|
|
2022-08-01 08:09:52 +09:00
|
|
|
async def cmd_quit_help():
|
|
|
|
normal = ['quit', 'help']
|
2022-06-15 14:39:54 +09:00
|
|
|
response = (
|
2022-08-01 08:09:52 +09:00
|
|
|
'Usage: quit\n'
|
2022-07-24 14:18:25 +09:00
|
|
|
'Commands:\n'
|
2022-08-01 08:09:52 +09:00
|
|
|
' quit......close the connection\n'
|
2022-06-15 14:39:54 +09:00
|
|
|
)
|
|
|
|
return normal, response
|
|
|
|
|
|
|
|
SPEC = Str({
|
2022-08-01 08:09:52 +09:00
|
|
|
None: End(cmd_quit),
|
|
|
|
'help': End(cmd_quit_help),
|
2022-06-15 14:39:54 +09:00
|
|
|
})
|