removed guard rails

This commit is contained in:
JJJHolscher 2024-11-04 11:32:47 +01:00
parent 1352f2738a
commit efa0f5b030

View File

@ -9,11 +9,7 @@ def cli():
args = ArgumentParser(description="Post on Bluesky.") args = ArgumentParser(description="Post on Bluesky.")
args.add_argument("handle", type=str, help="Your handle, usually {username}.bsky.social") args.add_argument("handle", type=str, help="Your handle, usually {username}.bsky.social")
args.add_argument("password", type=str, help="The password with which you log in to the app and site.") args.add_argument("password", type=str, help="The password with which you log in to the app and site.")
args.add_argument( args.add_argument("message", nargs="*",
"-m",
"--message",
type=str,
required=False,
help="The bare text message that you are about to post, leave empty to read the message from stdin." help="The bare text message that you are about to post, leave empty to read the message from stdin."
) )
return args.parse_args() return args.parse_args()
@ -71,6 +67,8 @@ def main():
# Get the message from the cli ... # Get the message from the cli ...
message = args.message message = args.message
if message:
message = " ".join(message)
# ... or stdin ... # ... or stdin ...
if not message: if not message:
message = get_stdin() message = get_stdin()
@ -81,9 +79,6 @@ def main():
if not message: if not message:
raise ValueError("You did not supply any message!") raise ValueError("You did not supply any message!")
print(message)
exit(0)
# We're only importing atproto here, because it is slow. # We're only importing atproto here, because it is slow.
from atproto import Client from atproto import Client