Commit b415bd42 authored by Łukasz Nowak's avatar Łukasz Nowak

cli: Allow to select any curl binary with nice default

parent ec0bf12b
...@@ -5,9 +5,10 @@ from . import recurlests ...@@ -5,9 +5,10 @@ from . import recurlests
@click.command(short_help="Runs curl's wrapper recurl") @click.command(short_help="Runs curl's wrapper recurl")
@click.option('--headers/--no-headers', help="Shows response headers", default=False, show_default=True) @click.option('--headers/--no-headers', help="Shows response headers", default=False, show_default=True)
@click.option('--output/--no-output', help="Shows the output", default=False, show_default=True) @click.option('--output/--no-output', help="Shows the output", default=False, show_default=True)
@click.option('--curl', help="Path to curl binary", default='curl', show_default=True)
@click.argument("url") @click.argument("url")
def runRecurl(headers, output, url): def runRecurl(headers, output, curl, url):
mimikra = recurlests.Recurlests() mimikra = recurlests.Recurlests(curl)
response = mimikra.get(url) response = mimikra.get(url)
print('Effective HTTP version:', response.effective_http_version) print('Effective HTTP version:', response.effective_http_version)
print('Response status code:', response.status_code) print('Response status code:', response.status_code)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment