Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def name_callback(name: str):
if name != "Camila":
raise typer.BadParameter("Only Camila is allowed")
def name_callback(ctx: typer.Context, value: str):
if ctx.resilient_parsing:
return
typer.echo("Validating name")
if value != "Camila":
raise typer.BadParameter("Only Camila is allowed")
return value
def name_callback(value: str):
if value != "Camila":
raise typer.BadParameter("Only Camila is allowed")
return value
def name_callback(value: str):
typer.echo("Validating name")
if value != "Camila":
raise typer.BadParameter("Only Camila is allowed")
return value
def name_callback(name: str):
if name != "Camila":
raise typer.BadParameter("Only Camila is allowed")
return name
def name_callback(ctx: typer.Context, param: typer.CallbackParam, value: str):
if ctx.resilient_parsing:
return
typer.echo(f"Validating param: {param.name}")
if value != "Camila":
raise typer.BadParameter("Only Camila is allowed")
return value