MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / _confirm_bundle_clear

Function _confirm_bundle_clear

src/codegraphcontext/cli/main.py:758–774  ·  view source on GitHub ↗

Return True if import may proceed; False if user cancelled.

(clear: bool, yes: bool)

Source from the content-addressed store, hash-verified

756 db_manager.close_driver()
757
758def _confirm_bundle_clear(clear: bool, yes: bool) -> bool:
759 """Return True if import may proceed; False if user cancelled."""
760 if not clear:
761 return True
762 console.print("[yellow]⚠️ Warning: This will clear all existing graph data![/yellow]")
763 if yes:
764 return True
765 if not sys.stdin.isatty():
766 console.print(
767 "[bold red]Refusing to clear graph in non-interactive mode. "
768 "Pass --yes / -y to confirm.[/bold red]"
769 )
770 raise typer.Exit(code=1)
771 if not typer.confirm("Are you sure you want to continue?", default=False):
772 console.print("[yellow]Import cancelled[/yellow]")
773 return False
774 return True
775
776
777@bundle_app.command("import")

Callers 1

bundle_importFunction · 0.85

Calls 1

printMethod · 0.80

Tested by

no test coverage detected