فهرست منبع

Add optional argument --name to pc init (#735)

Harish Chandran 2 سال پیش
والد
کامیت
a43a83ad24
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      pynecone/pc.py

+ 2 - 2
pynecone/pc.py

@@ -23,9 +23,9 @@ def version():
 
 
 @cli.command()
-def init():
+def init(name: str = typer.Option(None, help="Name of the app to be initialized.")):
     """Initialize a new Pynecone app in the current directory."""
-    app_name = prerequisites.get_default_app_name()
+    app_name = prerequisites.get_default_app_name() if name is None else name
 
     # Make sure they don't name the app "pynecone".
     if app_name == constants.MODULE_NAME: