Skip to content

Commit

Permalink
make verbose not the default
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam-D-Lewis committed May 6, 2024
1 parent b88aa1b commit 992ae28
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/_nebari/subcommands/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class InitInputs(schema.Base):
ssl_cert_email: Optional[schema.email_pydantic] = None
disable_prompt: bool = False
output: pathlib.Path = pathlib.Path("nebari-config.yaml")
verbose: bool = False


def enum_to_list(enum_cls):
Expand Down Expand Up @@ -152,7 +153,7 @@ def handle_init(inputs: InitInputs, config_schema: BaseModel):
try:
write_configuration(
inputs.output,
config_schema(**config),
config if not inputs.verbose else config_schema(**config),
mode="x",
)
except FileExistsError:
Expand Down Expand Up @@ -565,6 +566,12 @@ def init(
"-o",
help="Output file path for the rendered config file.",
),
verbose: bool = typer.Option(
False,
"--verbose",
"-v",
help="Write verbose nebari config file.",
),
):
"""
Create and initialize your [purple]nebari-config.yaml[/purple] file.
Expand Down Expand Up @@ -604,6 +611,7 @@ def init(
inputs.ssl_cert_email = ssl_cert_email
inputs.disable_prompt = disable_prompt
inputs.output = output
inputs.verbose = verbose

from nebari.plugins import nebari_plugin_manager

Expand Down Expand Up @@ -894,6 +902,14 @@ def guided_init_wizard(ctx: typer.Context, guided_init: str):
)
inputs.kubernetes_version = kubernetes_version

# VERBOSE
inputs.verbose = questionary.confirm(
"Would you like the nebari config to show all available options? (recommended for advanced users only)",
default=False,
qmark=qmark,
auto_enter=False,
).unsafe_ask()

from nebari.plugins import nebari_plugin_manager

config_schema = nebari_plugin_manager.config_schema
Expand Down

0 comments on commit 992ae28

Please sign in to comment.