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() args = parser.parse_args()
url = args.url url = args.url
interpreter = ["bash"]
pager = ["less"]
content = requests.get(url).content content = requests.get(url).content
if args.skip_pager: if args.skip_pager:
launch("bash", content) launch(interpreter, content)
else: else:
launch("less", content) launch(pager, content)
response = yn("Do you want to run this script?") response = yn("Do you want to run this script?")
if response == "y": if response == "y":
launch("bash", content) launch(interpreter, content)
else: else:
print("Script not run.") print("Script not run.")