ideawu / ssdb

SSDB - A fast NoSQL database, an alternative to Redis
http://ssdb.io/
BSD 3-Clause "New" or "Revised" License
8.19k stars 1.4k forks source link

Make ssdb-cli more silent when used in a script #1346

Closed ghen2 closed 4 years ago

ghen2 commented 4 years ago

like echo compact | ./ssdb-cli in a cron job.

When stdin is not a tty, skip the histfile and the printing of the welcome message, the prompt and the execution time of commands.

This way, a cron script can discard stdout, and still catch actual errors on stderr.

ghen2 commented 4 years ago

Resubmitted as https://github.com/ideawu/ssdb/issues/1347 for further discussion, as the patch is only a first draft.