From 76f9191b1bbf363a2ef7a1bc0aa306f3f39f25c7 Mon Sep 17 00:00:00 2001 From: SouthFox Date: Fri, 28 Jul 2023 01:22:08 +0800 Subject: [PATCH] [perf] misc script --- misc.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/misc.py b/misc.py index dde3df1..f34bf55 100644 --- a/misc.py +++ b/misc.py @@ -5,10 +5,15 @@ import click from Crypto.PublicKey import RSA from demo import config +from demo.boxes import send_note + +@click.group() +def misc(): + pass @click.command() -def gen_key(): +def gen_key(self): """Generate key.""" if config.KEY_PATH.exists(): print("Key is existing!") @@ -20,5 +25,14 @@ def gen_key(): print("Done!") +@click.command() +@click.option("--content", prompt="Note content") +def creat_note(content): + send_note(content) + + +misc.add_command(gen_key) +misc.add_command(creat_note) + if __name__ == "__main__": - gen_key() + misc()