cheat.sh
cheat.sh copied to clipboard
Also use pager for normal queries (but skip paging when output is not to a terminal)
I don't use --shell
very much, rather ad-hoc cht.sh <query>
in the shell. The paging that is used in shell mode would be helpful there as well, to avoid scrolling back in the terminal when there's long output.
The existing do_query()
function that is used in shell mode looks like it can be a drop-in replacement for the duplicated curl
calls, and with that we get paging for normal queries as well. (And this reuses any set session id as well.)
Some initializations need to be moved further up; they still don't run for --help
, --mode
, and --standalone-install
.