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

15 lines
336 B
Python
Raw Normal View History

2021-07-18 16:17:09 +00:00
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)