Use variables for pager and interpreter commands
This commit is contained in:
parent
580f215ce3
commit
123ade3e13
|
@ -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.")
|
||||
|
|
Loading…
Reference in New Issue
Block a user