Add -p/--pretty option to swaymsg

This new option forces pretty (non-raw/non-JSON) output. By default, when
not using a tty, swaymsg outputs using the "raw" format. This makes it
impossible to, for example, pipe the pretty output to a pager such as
`less` since piping does not use a tty.

The new -p/--pretty option gives the user explicit control over the output
format while retaining the default tty-dependent behavior.

Signed-off-by: Peter Grayson <pete@jpgrayson.net>
This commit is contained in:
Peter Grayson 2019-03-08 12:43:04 -05:00 committed by Drew DeVault
parent c8085038cf
commit bedf2ac2fb
5 changed files with 17 additions and 5 deletions

View file

@ -19,6 +19,9 @@ _swaymsg_ [options...] [message]
there is a malformed response or an invalid event type was requested,
swaymsg will stop monitoring and exit.
*-p, --pretty*
Use raw output even when not using a tty.
*-q, --quiet*
Sends the IPC message but does not print the response from sway.