From aefa15cde960ca4528d415337bbeb8e5f0072e44 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Thu, 6 Jul 2017 17:22:49 +0200 Subject: [PATCH] afm-util: make output more readable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: I919c3e6d34c74688162a0b0806a6397fb7601a76 Signed-off-by: José Bollo --- scripts/afm-util | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/scripts/afm-util b/scripts/afm-util index 9313b50..170def6 100755 --- a/scripts/afm-util +++ b/scripts/afm-util @@ -6,11 +6,19 @@ fi export DBUS_SESSION_BUS_ADDRESS pretty() { - sed \ - -e '/^method return .*/d' \ - -e 's/^Error org.freedesktop.DBus.Error.Failed: "\?\(.*\)"\?$/ERROR: \1/' \ - -e 's/^ string "\(.*\)"/\1/' \ - -e 's/},/&\n/' + sed ' /^method return .*/d + s/^Error org.freedesktop.DBus.Error.Failed: "\?\(.*\)"\?$/ERROR: \1/ + s/^ string "\(.*\)"/\1/ + s:[[{,]:&\n:g + s: *[]}]:\n&:g + ' | + sed ' s:^ *:: + s: *$:: + /[]}],*$/ {x;s:...::;x} + G + /[[{]\n/ {x;s:$: :;x} + s:^\(.*[^\n]\)\n\( *\)$:\2\1: + ' } send() { -- 2.16.6