Improve command-line output

This commit is contained in:
Samuel Sloniker 2022-04-08 14:11:23 -07:00
parent 9f6ec508ce
commit 3ab5be69a1

View File

@ -2,6 +2,7 @@
import requests import requests
import subprocess import subprocess
import sys import sys
import os
import argparse import argparse
import shlex import shlex
@ -57,7 +58,10 @@ url = args.url
pager = shlex.split(args.pager) pager = shlex.split(args.pager)
interpreter = shlex.split(args.interpreter) interpreter = shlex.split(args.interpreter)
print(f"Downloading `{url}`...")
content = requests.get(url).content content = requests.get(url).content
print("Download successful.")
print("=" * os.get_terminal_size().columns)
if args.skip_pager: if args.skip_pager:
launch(interpreter, content) launch(interpreter, content)
@ -66,7 +70,8 @@ else:
response = yn("Do you want to run this script?") response = yn("Do you want to run this script?")
if response == "y": if response == "y":
print("=" * 20) print("=" * os.get_terminal_size().columns)
launch(interpreter, content) launch(interpreter, content)
else: else:
print("=" * os.get_terminal_size().columns)
print("Script not run.") print("Script not run.")