diff --git a/README.md b/README.md index ee1046ad8f46192d31c7712c9ab1035fbc22c439..62e7cf142f353ca5316bd1569be7c1efa4c7e378 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..da11f2e489bd1ac3275424626c596307759c8bb7 100644 --- a/fastapi_template/input_model.py +++ b/fastapi_template/input_model.py @@ -15,7 +15,7 @@ class DatabaseType(enum.Enum): @enum.unique class CIType(enum.Enum): none = "none" - gitlab_ci = "gitlab" + gitlab_ci = "gitlab_ci" github = "github" @enum.unique @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 82b0e582aec8b4bcd1f3ba1947585d8bd815af67..7bb3d584a1cbed6b56327aedc36ff5a0011744b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fastapi_template" -version = "3.2.2" +version = "3.3.0" description = "Feature-rich robust FastAPI template" authors = ["Pavel Kirilin <win10@list.ru>"] packages = [{ include = "fastapi_template" }]