aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/afm-util
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-07-06 17:22:49 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-07-06 17:22:49 +0200
commit8c550986fb98fd0848f0af3117e548d4359e3f5a (patch)
treec8b095986766de591ca66bc9246e6dd75f962450 /scripts/afm-util
parent972a2048f3662806cef41c0e6f44cb3bdec0cc86 (diff)
afm-util: make output more readable
Change-Id: Idfa35a60f3ee6268d2f08304e5ad2248777d2002 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'scripts/afm-util')
-rwxr-xr-xscripts/afm-util18
1 files 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() {