Skip to content

Instantly share code, notes, and snippets.

@lewoudar
Created November 30, 2020 19:14
Show Gist options
  • Save lewoudar/083eca20d3e162ee5540038563cf6565 to your computer and use it in GitHub Desktop.
Save lewoudar/083eca20d3e162ee5540038563cf6565 to your computer and use it in GitHub Desktop.
Example of less command implemented with click
import click
@click.command()
@click.argument('file', type=click.File())
def cli(file):
"""Read file part by part"""
click.echo_via_pager(file.read())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment