From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: network@lists.ipfire.org Subject: Re: [PATCH 5/8] header-config: add generic hhok_hid function Date: Tue, 25 Jul 2017 23:29:30 +0100 Message-ID: <1501021770.20312.36.camel@ipfire.org> In-Reply-To: <1500998833-10543-6-git-send-email-jonatan.schlag@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9081771528689363534==" List-Id: --===============9081771528689363534== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit On Tue, 2017-07-25 at 18:07 +0200, Jonatan Schlag wrote: > This function will always be there so when we call hhok_hid we will get a > result. > This is also nice for testing. > > Signed-off-by: Jonatan Schlag > --- >  src/header-config | 8 ++++++++ >  1 file changed, 8 insertions(+) > > diff --git a/src/header-config b/src/header-config > index e3c6423..76f4bb5 100644 > --- a/src/header-config > +++ b/src/header-config > @@ -76,3 +76,11 @@ hook_edit() { >   >   exit ${EXIT_OK} >  } > + > +# We will return the id as generic variant of the hid > +# Although this should not be the standard > +hook_hid() { > + assert [ $# -eq 1 ] > + local config=${1} > + echo $(config_get_id_from_config ${config}) > +} Just call "config_get_if_from_config ${config}". Doesn't need the echo. Also remove the assert here. The hook should always assume that it is being called with the correct number of arguments and this will also make auto- completion slower. -Michael --===============9081771528689363534== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjIKCmlRSWNCQUFC Q2dBR0JRSlpkOFpLQUFvSkVJQjU4UDl2a0FrSHNqd1FBS0Fpay8xaWZTRWZXUUdlOTBEUUZpRzkK eGd0UDBIeVRhaUpUR2NFMkdSVkhDTkFjdDhUNVBxdlEzUXIvcFV2eU5MVE16eWpZTWZiK0trVmkv TDQzZTVXaApPcjRVN3lzcVZPNVkxeFp4eVZJU2k2ZTFneEdkS1NtQ0VhNU8zTkppNnc0Z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