mirror of
https://github.com/rjNemo/pass-gen
synced 2026-06-06 02:26:42 +00:00
20 lines
368 B
Python
20 lines
368 B
Python
import random as r
|
|
|
|
import typer
|
|
|
|
from .pass_gen import generate_password
|
|
|
|
app = typer.Typer()
|
|
|
|
|
|
@app.command()
|
|
def main(
|
|
random: bool = True,
|
|
length: int = typer.Option(8, help="Length of the generated password."),
|
|
) -> None:
|
|
seed = r.randint(0, 100) if random else 0
|
|
typer.echo(generate_password(seed, length))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
app()
|