Improve command-line output
This commit is contained in:
parent
9f6ec508ce
commit
3ab5be69a1
|
@ -2,6 +2,7 @@
|
|||
import requests
|
||||
import subprocess
|
||||
import sys
|
||||
import os
|
||||
import argparse
|
||||
import shlex
|
||||
|
||||
|
@ -57,7 +58,10 @@ url = args.url
|
|||
pager = shlex.split(args.pager)
|
||||
interpreter = shlex.split(args.interpreter)
|
||||
|
||||
print(f"Downloading `{url}`...")
|
||||
content = requests.get(url).content
|
||||
print("Download successful.")
|
||||
print("=" * os.get_terminal_size().columns)
|
||||
|
||||
if args.skip_pager:
|
||||
launch(interpreter, content)
|
||||
|
@ -66,7 +70,8 @@ else:
|
|||
|
||||
response = yn("Do you want to run this script?")
|
||||
if response == "y":
|
||||
print("=" * 20)
|
||||
print("=" * os.get_terminal_size().columns)
|
||||
launch(interpreter, content)
|
||||
else:
|
||||
print("=" * os.get_terminal_size().columns)
|
||||
print("Script not run.")
|
||||
|
|
Loading…
Reference in New Issue
Block a user