-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Siddhesh-Agarwal/cli
added CLI Tool
- Loading branch information
Showing
5 changed files
with
279 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from rich.console import Console | ||
from typer import Typer | ||
|
||
from cryptmoji.main import decrypt, encrypt | ||
|
||
app = Typer() | ||
console = Console() | ||
|
||
|
||
@app.command("encrypt") | ||
def cli_encrypt(text: str): | ||
"""Encrypts a string as a string of emojis.""" | ||
key = console.input( | ||
"Key (optional): ", | ||
markup=False, | ||
emoji=False, | ||
password=True, | ||
) | ||
|
||
console.print(encrypt(text, key=key if key else None)) | ||
|
||
|
||
@app.command("decrypt") | ||
def cli_decrypt(text: str): | ||
"""Decrypts a string of emojis.""" | ||
key = console.input( | ||
"Key (optional): ", | ||
markup=False, | ||
emoji=False, | ||
password=True, | ||
) | ||
console.print(decrypt(text, key=key if key else None)) |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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