mirror of
https://github.com/rjNemo/pass-gen
synced 2026-06-06 02:26:42 +00:00
feat: password copied to clipboard
This commit is contained in:
parent
1c2da99c1a
commit
cdc2dbe984
2 changed files with 8 additions and 2 deletions
|
|
@ -7,4 +7,4 @@
|
|||
- [x] Include symbols
|
||||
- [x] Include numbers
|
||||
- [ ] As a user I want the generated password to be copied to the clipboard
|
||||
- [ ] As a user I want the generated password to be saved to a file
|
||||
- [x] As a user I want the generated password to be saved to a file
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import random as r
|
||||
import subprocess
|
||||
|
||||
import typer
|
||||
|
||||
|
|
@ -19,7 +20,12 @@ def main(
|
|||
),
|
||||
) -> None:
|
||||
seed = r.randint(0, 100) if random else 0
|
||||
typer.echo(generate_password(seed, length, symbols, numbers))
|
||||
password = generate_password(seed, length, symbols, numbers)
|
||||
|
||||
subprocess.run("pbcopy", universal_newlines=True, input=password)
|
||||
|
||||
typer.echo(f"🔐 {password}")
|
||||
typer.echo("The password has been copied to your clipboard 😉")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Reference in a new issue