#!/usr/bin/env lua

local arrr = require 'arrr'
local params = arrr {
	{ "Sets the root to search in", "--root", "-r", 'root' };
}{...}

local buf = {}

local root = params.root or "."

for _, argument in ipairs(params) do
	table.insert(buf, "-name '"..argument:gsub("'", [['"'"']]).."'")
end

os.execute("find "..root.." " .. table.concat(buf, " -or "))