-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added commands with interactive prompts (#66)
If your command needs some terminal interactivity, simply add [`prompts: Prompts` argument](#basic-terminal-user-interface-tui-primitives) to your command: ```python from databricks.sdk import WorkspaceClient from databricks.labs.blueprint.entrypoint import get_logger from databricks.labs.blueprint.cli import App from databricks.labs.blueprint.tui import Prompts app = App(__file__) logger = get_logger(__file__) @app.command def me(w: WorkspaceClient, prompts: Prompts): """Shows current username""" if prompts.confirm("Are you sure?"): logger.info(f"Hello, {w.current_user.me().user_name}!") if "__main__" == __name__: app() ``` Fix #49
- Loading branch information
Showing
3 changed files
with
87 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters