Added soypakcli.py
The soypak CLI interface module which handles arg parsing and the initialisation of soypak.
This commit is contained in:
parent
23fd41ce03
commit
ce8365ebe7
24
soypak/cli/soypakcli.py
Normal file
24
soypak/cli/soypakcli.py
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
import sys
|
||||||
|
import soypak.cli.parser as parser
|
||||||
|
|
||||||
|
|
||||||
|
# :@TODO: remove this and implement the following:
|
||||||
|
# - a class which will auto-add commands to the CLI which can be ran (eopkg autocommand).
|
||||||
|
# - this will inherit `type` and be inherited as a metaclass `class ...(metaclass=...)`
|
||||||
|
|
||||||
|
class SoypakCLI:
|
||||||
|
def __init__(self) -> None:
|
||||||
|
_parser = parser.SoypakParser()
|
||||||
|
cmd, args = _parser.parse_args()
|
||||||
|
|
||||||
|
if len(args) == 0:
|
||||||
|
if _parser.namespace.version:
|
||||||
|
print(_parser.VERSION)
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
print(cmd, args)
|
||||||
|
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
# :@TODO: run commands
|
||||||
|
...
|
||||||
Loading…
Reference in New Issue
Block a user