Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/core/parser/command.py
2021-07-19 00:17:09 +08:00

15 lines
No EOL
336 B
Python

import shlex
from core.docopt import docopt
class InvalidCommandFormatError:
def __init__(self, *args, **kwargs):
pass
class CommandParser:
def __init__(self, args: str):
self.args = 'Usage:\n' + args
def parse(self, command):
return docopt(self.args, argvs=shlex.split(command)[1:], help=False)