From 7371925ae522f3e982f1b645646476d04742e21c Mon Sep 17 00:00:00 2001 From: dvs1 Date: Thu, 24 Oct 2024 18:23:09 +1000 Subject: Rename also to Then. --- _.lua | 2 +- test_.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_.lua b/_.lua index 33b4183..9e39c36 100755 --- a/_.lua +++ b/_.lua @@ -156,7 +156,7 @@ __ = function(c) function exe:log() self.logging = true return self end function exe:show() self.showing = true return self end -- Should be called "then" but that's a reserved word. - function exe:also(c) if nil == c then c = '' else c = ' ' .. c end self.cmd = self.cmd .. '; ' .. c .. ' ' return self end + function exe:Then(c) if nil == c then c = '' else c = ' ' .. c end self.cmd = self.cmd .. '; ' .. c .. ' ' return self end function exe:And(c) if nil == c then c = '' else c = ' ' .. c end self.cmd = self.cmd .. ' && ' .. c .. ' ' return self end function exe:Or(c) if nil == c then c = '' else c = ' ' .. c end self.cmd = self.cmd .. ' || ' .. c .. ' ' return self end function exe:noErr() self.cmd = self.cmd .. ' 2>/dev/null ' return self end diff --git a/test_.lua b/test_.lua index e559238..e4448d2 100755 --- a/test_.lua +++ b/test_.lua @@ -85,7 +85,7 @@ for i,l in ipairs(__'uname -a\nfree -h':log():Do().lines) do end print('') -__'uname -a':log():also'free -h':show():Do() +__'uname -a':log():Then'free -h':show():Do() print('') __{'uname -a', 'free -h'}:log():show():Do() -- cgit v1.1