[syslog-ng] [PATCH] tfhash: New template function to calculate the SHA1 of its input

Gergely Nagy algernon at madhouse-project.org
Sun Aug 5 17:37:07 CEST 2012


Gergely Nagy <algernon at madhouse-project.org> writes:

>> 1) template functions should rather use command-line parsing than
>> positional arguments. (e.g. I'd prefer --method, --length, etc as
>> arguments instead of hardcoding the order)
>
> Well, in general, I would agree, but not in this case: for $(hash), the
> method is mandatory - at least in the version I made from Peter's
> original -, so is the string, length is the only optional argument, and
> $(hash --method SHA1 --length 8 $BLAH) is longer than $(hash SHA1 $BLAH
> 8) and is not easier to understand, either, as far as I'm concerned.

Nevermind that. If we want to support multiple positional arguments,
then --length needs to be a dashed-option anyway. I'd keep the rest (ie,
method) as positional though.

I'll push the updated code to the same branch in a couple of hours.

-- 
|8]


More information about the syslog-ng mailing list