bug-datamash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The 'cut' operation should have synonyms


From: Tim Rice
Subject: Re: The 'cut' operation should have synonyms
Date: Thu, 2 Jun 2022 22:31:06 +0000

Hi Dima, all,

I've attached a patch which aims to implement 'echo' and 'uniq' as aliases to 
'cut' and 'unique' respectively. Anyone who is interested should be able to try 
it out with `git apply /path/to/patch'.

I'm not quite sure whether to merge it. If you look in the tests, you'll see that when 
datamash tries to do a "reverse lookup" of what command was used, it can't see 
the alias. It instead sees the original command. (Basically because of what comes first 
in a particular array, iiuc.)

Perhaps that's reasonable behavior for what is clearly flagged as just an 
alias. Furthermore, to try to fix it would require some refactoring of the 
field_operation structures, I think. If this is necessary, it should wait until 
after v1.8 has been released.

Feedback welcome. I'll merge it tomorrow (i.e. Saturday morning Australia time) 
if no significant objections arise.

~ Tim

Attachment: alias-cut-unique.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]