[3/8] zone: config list print also hids
Message ID | 1500998833-10543-4-git-send-email-jonatan.schlag@ipfire.org |
---|---|
State | Accepted |
Commit | fc36aaf45ddb7b8f1dcdcbcd65b02e8db434f97a |
Headers |
Return-Path: <network-bounces@lists.ipfire.org> Received: from mail01.ipfire.org (unknown [172.28.1.200]) by web02.ipfire.org (Postfix) with ESMTP id 235EE61CAF for <patchwork@ipfire.org>; Tue, 25 Jul 2017 18:07:25 +0200 (CEST) Received: from mail01.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id D85B827D3; Tue, 25 Jul 2017 18:07:24 +0200 (CEST) Received: from ipfire.localdomain (dslb-088-073-218-016.088.073.pools.vodafone-ip.de [88.73.218.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 850A927CE; Tue, 25 Jul 2017 18:07:21 +0200 (CEST) From: Jonatan Schlag <jonatan.schlag@ipfire.org> To: network@lists.ipfire.org Subject: [PATCH 3/8] zone: config list print also hids Date: Tue, 25 Jul 2017 18:07:08 +0200 Message-Id: <1500998833-10543-4-git-send-email-jonatan.schlag@ipfire.org> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1500998833-10543-1-git-send-email-jonatan.schlag@ipfire.org> References: <1500998833-10543-1-git-send-email-jonatan.schlag@ipfire.org> X-BeenThere: network@lists.ipfire.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List for the network package <network.lists.ipfire.org> List-Unsubscribe: <http://lists.ipfire.org/mailman/options/network>, <mailto:network-request@lists.ipfire.org?subject=unsubscribe> List-Archive: <http://lists.ipfire.org/pipermail/network/> List-Post: <mailto:network@lists.ipfire.org> List-Help: <mailto:network-request@lists.ipfire.org?subject=help> List-Subscribe: <http://lists.ipfire.org/mailman/listinfo/network>, <mailto:network-request@lists.ipfire.org?subject=subscribe> Errors-To: network-bounces@lists.ipfire.org Sender: "network" <network-bounces@lists.ipfire.org> |
Message
Jonatan Schlag
July 26, 2017, 2:07 a.m. UTC
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
---
src/functions/functions.zone | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
Comments
This looks good. It might be better to print just "-" if there is no HID, but that only makes parsing this output easier which nobody should be doing any ways... -Michael On Tue, 2017-07-25 at 18:07 +0200, Jonatan Schlag wrote: > Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org> > --- > src/functions/functions.zone | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/src/functions/functions.zone b/src/functions/functions.zone > index 091bcd6..17d0858 100644 > --- a/src/functions/functions.zone > +++ b/src/functions/functions.zone > @@ -634,21 +634,22 @@ zone_config_list() { > assert isset zone > > # Print a nice header > - local format="%-3s %-20s" > - print "${format}" "ID" "HOOK" > + local format="%-3s %-20s %-20s" > + print "${format}" "ID" "HOOK" "HID" > > local config > local hook > local id > + local hid > > # Print for all config: > # id and hook > - # TODO: Add hids here > for config in $(zone_configs_list "${zone}"); do > id=${config##*.} > hook=$(zone_config_get_hook "${zone}" "${config}") > + hid=$(zone_config_get_hid "${zone}" "${config}") > assert isset hook > - print "${format}" "${id}" "${hook}" > + print "${format}" "${id}" "${hook}" "${hid}" > done > } >