summaryrefslogtreecommitdiff
path: root/Keywords/sample.ucl
diff options
context:
space:
mode:
Diffstat (limited to 'Keywords/sample.ucl')
-rw-r--r--Keywords/sample.ucl16
1 files changed, 16 insertions, 0 deletions
diff --git a/Keywords/sample.ucl b/Keywords/sample.ucl
index 5022254bcfd2..1a216f0836de 100644
--- a/Keywords/sample.ucl
+++ b/Keywords/sample.ucl
@@ -20,6 +20,22 @@
actions: [file(1)]
arguments: true
+prepackaging: <<EOS
+ if #arg == 1 then
+ if string.find(arg[1], "%.sample$") == nil then
+ io.stderr:write("@sample with 1 single argument expect \".sample\" extension\n")
+ return(1)
+ end
+ elseif #arg == 2 then
+ if arg[1] == arg[2] then
+ io.stderr:write("@sample: 2 identicals arguments are provided\n")
+ return(1)
+ end
+ else
+ io.stderr:write("@sample expect 1 or 2 arguments, got " .. #arg .. "\n")
+ return(1)
+ end
+EOS
post-install-lua: <<EOS
args = {}
for arg in string.gmatch("%@", "%S+") do