diff --git a/README.md b/README.md index 6f25a022c8e6d787cc068d8fbfa2b395e73f255e..74a5db7d3d687118923ae545c97800c35c9ce1ba 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ usage: FastAPI template [-h] [--version] [--name PROJECT_NAME] [--orm {ormar,sqlalchemy,tortoise}] [--ci {none,gitlab,github}] [--redis] [--migrations] [--kube] [--dummy] [--routers] [--swagger] [--force] + [--quite] optional arguments: -h, --help show this help message and exit @@ -92,4 +93,5 @@ optional arguments: --routers Add exmaple routers --swagger Eanble self-hosted swagger --force Owerrite directory if it exists + --quite Do not ask for feature during generation ``` diff --git a/fastapi_template/cli.py b/fastapi_template/cli.py index b0933e1890ab604c6171e33a587f3dd49fff204d..54f8930276bdccc221b0d9909af33130ed31a2f5 100644 --- a/fastapi_template/cli.py +++ b/fastapi_template/cli.py @@ -118,6 +118,13 @@ def parse_args(): default=False, dest="force", ) + parser.add_argument( + "--quite", + help="Do not ask for feature during generation", + action="store_true", + default=False, + dest="quite", + ) return parser.parse_args() @@ -155,7 +162,7 @@ def ask_features(current_context: BuilderContext) -> BuilderContext: if feature["value"] is None: setattr(current_context, feature["name"], False) checkbox_values.append((feature["name"], feature_name)) - if checkbox_values: + if checkbox_values and not current_context.quite: results = checkboxlist_dialog( title="Features", text="What features do you wanna add?", diff --git a/fastapi_template/input_model.py b/fastapi_template/input_model.py index 9a35b8f0c0ba0bde505a692411177cf2cb5b015c..be45077ba29a077bf5973f415a7a4abf5d924771 100644 --- a/fastapi_template/input_model.py +++ b/fastapi_template/input_model.py @@ -87,6 +87,7 @@ class BuilderContext(BaseModel): add_dummy: Optional[bool] = False self_hosted_swagger: Optional[bool] force: bool = False + quite: bool = False class Config: orm_mode = True