@app.command()
def fun(url: str, out: Optional[str]=None) -> None:
    doc = get_document(url)
    doc_summary = doc.summary()
    if (out is None):
        print(doc_summary)
    else:
        with open(out, 'w') as f:
            f.write(doc_summary)
@app.command()
def fun(url: str, out: Optional[str]=None) -> None:
    doc = get_document(url)
    doc_summary = doc.summary()
    if (out is None):
        print(doc_summary)
    else:
        with open(out, 'w') as f:
            f.write(doc_summary)