X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=scripts%2Fafm-util;h=bbab51b2452e9929919186b5e0429095ab4e26ca;hb=41d9e2f1d2baca146d4956813642936d852b9dfb;hp=9313b5007df65b9f58a4fdfa2334c47d0de24f98;hpb=31943af2e46375265bb865e20a6e50f365d2a6dd;p=src%2Fapp-framework-main.git diff --git a/scripts/afm-util b/scripts/afm-util index 9313b50..bbab51b 100755 --- a/scripts/afm-util +++ b/scripts/afm-util @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash if [ "x" = "x${DBUS_SESSION_BUS_ADDRESS}" ]; then DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$UID/bus" @@ -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() {