diff --git a/toot/commands.py b/toot/commands.py index 7cf4c86..2e44bc5 100644 --- a/toot/commands.py +++ b/toot/commands.py @@ -74,8 +74,15 @@ def post(app, user, args): media = _do_upload(app, user, args.media) media_ids = [media['id']] else: + media = None media_ids = None + if media and not args.text: + args.text = media['text_url'] + + if not args.text: + raise ConsoleError("You must specify either text or media to post.") + response = api.post_status(app, user, args.text, args.visibility, media_ids) print_out("Toot posted: {}".format(response.get('url'))) diff --git a/toot/console.py b/toot/console.py index 4590807..f311b7a 100644 --- a/toot/console.py +++ b/toot/console.py @@ -144,6 +144,7 @@ POST_COMMANDS = [ arguments=[ (["text"], { "help": "The status text to post.", + "nargs": "?", }), (["-m", "--media"], { "type": FileType('rb'),