villebro commented on code in PR #36308:
URL: https://github.com/apache/superset/pull/36308#discussion_r2577949168


##########
superset-extensions-cli/src/superset_extensions_cli/cli.py:
##########
@@ -404,19 +404,81 @@ def backend_watcher() -> None:
 
 
 @app.command()
-def init() -> None:
-    id_ = click.prompt("Extension ID (unique identifier, alphanumeric only)", 
type=str)
[email protected](
+    "--id",
+    "id_opt",
+    default=None,
+    help="Extension ID (alphanumeric and underscores only)",
+)
[email protected]("--name", "name_opt", default=None, help="Extension display 
name")
[email protected](
+    "--version", "version_opt", default=None, help="Initial version (default: 
0.1.0)"
+)
[email protected](
+    "--license", "license_opt", default=None, help="License (default: 
Apache-2.0)"
+)
[email protected](
+    "--frontend/--no-frontend", "frontend_opt", default=None, help="Include 
frontend"
+)
[email protected](
+    "--backend/--no-backend", "backend_opt", default=None, help="Include 
backend"
+)
+def init(
+    id_opt: str | None,
+    name_opt: str | None,
+    version_opt: str | None,
+    license_opt: str | None,
+    frontend_opt: bool | None,
+    backend_opt: bool | None,
+) -> None:
+    # Check if running in non-interactive mode (required options provided)
+    non_interactive = (
+        id_opt is not None
+        and name_opt is not None
+        and frontend_opt is not None
+        and backend_opt is not None
+    )

Review Comment:
   Instead of interactive vs non-interactive, could we just skip asking the 
options that are provided in the CLI call, and prompt for the ones that weren't 
provided up front? I.e. always doing `xyz = xyz_opt or click.prompt("Give me 
xyz", type=str)`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to