Skip to content
Snippets Groups Projects
Unverified Commit a3c6c8a1 authored by Yaroslav Demidenko's avatar Yaroslav Demidenko Committed by GitHub
Browse files

Added quite arg for features (#49)


* Added quite arg for features

Co-authored-by: default avatarPavel Kirilin <win10@list.ru>
parent 9d88a156
No related branches found
No related tags found
No related merge requests found
...@@ -71,6 +71,7 @@ usage: FastAPI template [-h] [--version] [--name PROJECT_NAME] ...@@ -71,6 +71,7 @@ usage: FastAPI template [-h] [--version] [--name PROJECT_NAME]
[--orm {ormar,sqlalchemy,tortoise}] [--orm {ormar,sqlalchemy,tortoise}]
[--ci {none,gitlab,github}] [--redis] [--migrations] [--ci {none,gitlab,github}] [--redis] [--migrations]
[--kube] [--dummy] [--routers] [--swagger] [--force] [--kube] [--dummy] [--routers] [--swagger] [--force]
[--quite]
optional arguments: optional arguments:
-h, --help show this help message and exit -h, --help show this help message and exit
...@@ -92,4 +93,5 @@ optional arguments: ...@@ -92,4 +93,5 @@ optional arguments:
--routers Add exmaple routers --routers Add exmaple routers
--swagger Eanble self-hosted swagger --swagger Eanble self-hosted swagger
--force Owerrite directory if it exists --force Owerrite directory if it exists
--quite Do not ask for feature during generation
``` ```
...@@ -118,6 +118,13 @@ def parse_args(): ...@@ -118,6 +118,13 @@ def parse_args():
default=False, default=False,
dest="force", 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() return parser.parse_args()
...@@ -155,7 +162,7 @@ def ask_features(current_context: BuilderContext) -> BuilderContext: ...@@ -155,7 +162,7 @@ def ask_features(current_context: BuilderContext) -> BuilderContext:
if feature["value"] is None: if feature["value"] is None:
setattr(current_context, feature["name"], False) setattr(current_context, feature["name"], False)
checkbox_values.append((feature["name"], feature_name)) checkbox_values.append((feature["name"], feature_name))
if checkbox_values: if checkbox_values and not current_context.quite:
results = checkboxlist_dialog( results = checkboxlist_dialog(
title="Features", title="Features",
text="What features do you wanna add?", text="What features do you wanna add?",
......
...@@ -87,6 +87,7 @@ class BuilderContext(BaseModel): ...@@ -87,6 +87,7 @@ class BuilderContext(BaseModel):
add_dummy: Optional[bool] = False add_dummy: Optional[bool] = False
self_hosted_swagger: Optional[bool] self_hosted_swagger: Optional[bool]
force: bool = False force: bool = False
quite: bool = False
class Config: class Config:
orm_mode = True orm_mode = True
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment