darkrc/bin/find_files

17 lines
353 B
Text
Raw Permalink Normal View History

2023-02-18 21:03:28 +00:00
#!/usr/bin/env lua
local arrr = require 'arrr'
local params = arrr {
{ "Sets the root to search in", "--root", "-r", true };
}{...}
2023-02-18 21:03:28 +00:00
local buf = {}
local root = params.root or "."
for _, argument in ipairs(params) do
2023-02-18 21:03:28 +00:00
table.insert(buf, "-name '"..argument:gsub("'", [['"'"']]).."'")
end
os.execute("find "..root.." " .. table.concat(buf, " -or "))