From ec6d5fd2a25d5a3c7697c25798b665a6734e35c8 Mon Sep 17 00:00:00 2001 From: Joe Kaufeld Date: Thu, 6 Apr 2023 14:12:48 -0400 Subject: [PATCH] :sparkles: add bson objectId --- src/cli.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/cli.py b/src/cli.py index 469a13f..dbc8d19 100644 --- a/src/cli.py +++ b/src/cli.py @@ -48,6 +48,15 @@ def uuid4(): click.echo(uuid.uuid4()) +@main.command() +def objectid(): + """Generate a random ObjectID.""" + new_id = '' + for _ in range(24): + new_id += random.choice(string.ascii_lowercase[:6] + string.digits) + click.echo(new_id) + + @main.command() @click.argument("dice") def roll(dice: str): @@ -120,7 +129,7 @@ def update_from_gitea(): if release_data["tag_name"] == src.__version__: status.stop() click.echo( - "Server version is the same as current version;" " nothing to update." + "Server version is the same as current version; nothing to update." ) return status.update("Updating...")