Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add output pager to verbose commands #50

Open
craigds opened this issue Apr 16, 2020 · 2 comments
Open

Add output pager to verbose commands #50

craigds opened this issue Apr 16, 2020 · 2 comments

Comments

@craigds
Copy link
Member

craigds commented Apr 16, 2020

This came up as part of #48. Some commands generate a lot of output, and mostly we don't pipe them to a pager at the moment.

Some of our commands exec git directly, so those may use a pager already, but over time more of the commands will probably be directly implemented in sno rather than execcing git.

We should add an output pager (presumably usually less) and ways of customising it.

@rcoup
Copy link
Member

rcoup commented Apr 21, 2020

Looks like Click already has a solution for this (and further down the same page, "Launching Editors") 👏

We should start by trying that out

@craigds
Copy link
Member Author

craigds commented Apr 30, 2020

LGTM. So to implement that, we need to:

  • change all the output-format functions to yield click.style(s, ...) everywhere rather than click.secho(s, ...)
  • make diff_with_writer responsible for resolving output paths to file objects, rather than the individual output-format functions
  • make diff_with_writer send generated output to a click.echo_via_pager(...)

Other (than show/diff) commands are probably a bit simpler but also in less need of a pager. log already has a pager because it execs git directly

craigds added a commit that referenced this issue May 29, 2020
craigds added a commit that referenced this issue May 29, 2020
craigds added a commit that referenced this issue Jun 2, 2020
craigds added a commit that referenced this issue Jun 5, 2020
craigds added a commit that referenced this issue Jun 5, 2020
craigds added a commit that referenced this issue Jun 5, 2020
craigds added a commit that referenced this issue Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants