Use variables for pager and interpreter commands

This commit is contained in:
Samuel Sloniker 2022-04-08 13:00:28 -07:00
parent 580f215ce3
commit 123ade3e13

View File

@ -41,15 +41,18 @@ parser.add_argument(
args = parser.parse_args()
url = args.url
interpreter = ["bash"]
pager = ["less"]
content = requests.get(url).content
if args.skip_pager:
launch("bash", content)
launch(interpreter, content)
else:
launch("less", content)
launch(pager, content)
response = yn("Do you want to run this script?")
if response == "y":
launch("bash", content)
launch(interpreter, content)
else:
print("Script not run.")