Re: [PATCH] qmp-shell: Suppress banner and prompt when stdin is not a TTY

2021-01-20 Thread Dov Murik
On 20/01/2021 17:46, John Snow wrote: On 1/20/21 4:45 AM, Daniel P. Berrangé wrote: On Wed, Jan 20, 2021 at 10:25:25AM +0200, Dov Murik wrote: Hi John, On 19/01/2021 22:02, John Snow wrote: On 1/17/21 2:27 AM, Dov Murik wrote: Detect whether qmp-shell's standard input is not a TTY; in suc

Re: [PATCH] qmp-shell: Suppress banner and prompt when stdin is not a TTY

2021-01-20 Thread John Snow
On 1/20/21 4:45 AM, Daniel P. Berrangé wrote: On Wed, Jan 20, 2021 at 10:25:25AM +0200, Dov Murik wrote: Hi John, On 19/01/2021 22:02, John Snow wrote: On 1/17/21 2:27 AM, Dov Murik wrote: Detect whether qmp-shell's standard input is not a TTY; in such case, assume a non-interactive mode, whi

Re: [PATCH] qmp-shell: Suppress banner and prompt when stdin is not a TTY

2021-01-20 Thread Daniel P . Berrangé
On Wed, Jan 20, 2021 at 10:25:25AM +0200, Dov Murik wrote: > Hi John, > > On 19/01/2021 22:02, John Snow wrote: > > On 1/17/21 2:27 AM, Dov Murik wrote: > > > Detect whether qmp-shell's standard input is not a TTY; in such case, > > > assume a non-interactive mode, which suppresses the welcome ban

Re: [PATCH] qmp-shell: Suppress banner and prompt when stdin is not a TTY

2021-01-20 Thread Dov Murik
Hi John, On 19/01/2021 22:02, John Snow wrote: On 1/17/21 2:27 AM, Dov Murik wrote: Detect whether qmp-shell's standard input is not a TTY; in such case, assume a non-interactive mode, which suppresses the welcome banner and the "(QEMU)" prompt.  This allows for easier consumption of qmp-shell'

Re: [PATCH] qmp-shell: Suppress banner and prompt when stdin is not a TTY

2021-01-19 Thread John Snow
On 1/17/21 2:27 AM, Dov Murik wrote: Detect whether qmp-shell's standard input is not a TTY; in such case, assume a non-interactive mode, which suppresses the welcome banner and the "(QEMU)" prompt. This allows for easier consumption of qmp-shell's output in scripts. Example usage before this c

[PATCH] qmp-shell: Suppress banner and prompt when stdin is not a TTY

2021-01-16 Thread Dov Murik
Detect whether qmp-shell's standard input is not a TTY; in such case, assume a non-interactive mode, which suppresses the welcome banner and the "(QEMU)" prompt. This allows for easier consumption of qmp-shell's output in scripts. Example usage before this change: $ printf "query-status\nque