Skip to content

Commit

Permalink
feat: add init cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
czasg committed Oct 26, 2024
1 parent cdd6ddd commit c428ecc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions entrypoint/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# coding: utf-8
import cc
import entrypoint.init
import entrypoint.server


Expand All @@ -21,6 +22,7 @@ def descriptions(self) -> str:
def main():
cmd = PywssCommand()
cmd.add(
entrypoint.init.InitCommand(),
entrypoint.server.ServerCommand(),
)
cc.Execute(cmd)
Expand Down
11 changes: 11 additions & 0 deletions entrypoint/init/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# coding: utf-8
import cc

from .project import ProjectCommand


class InitCommand(cc.Command):

def __init__(self):
super().__init__()
self.add(ProjectCommand())
11 changes: 11 additions & 0 deletions entrypoint/init/project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# coding: utf-8
import cc
import loggus


class ProjectCommand(cc.Command):
class flags:
name = cc.FlagStr(flags=["-n", "--name"], description="project name", require=True)

def run(self, *args, **flags):
loggus.info(f"init project: {self.flags.name.value()}")

0 comments on commit c428ecc

Please sign in to comment.