-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3192df1
commit 0f83747
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
require('arghelper') | ||
|
||
local dir_matcher = clink.argmatcher():addarg(clink.dirmatches) | ||
|
||
-- luacheck: push | ||
-- luacheck: no max line length | ||
local flag_def_table = { | ||
{"/r", dir_matcher, " dir", "Recursively searches and displays the files that match the given pattern starting from the specified directory"}, | ||
{"/q", "Returns only the exit code, without displaying the list of matched files. (Quiet mode)"}, | ||
{"/f", "Displays the matched filename in double quotes"}, | ||
{"/t", "Displays the file size, last modified date and time for all matched files"}, | ||
{"/?", "Displays help message"}, | ||
} | ||
-- luacheck: pop | ||
|
||
local flags = {} | ||
for _,f in ipairs(flag_def_table) do | ||
if f[3] then | ||
table.insert(flags, { f[1]..f[2], f[3], f[4] }) | ||
if f[1]:upper() ~= f[1] then | ||
table.insert(flags, { hide=true, f[1]:upper()..f[2], f[3], f[4] }) | ||
end | ||
else | ||
table.insert(flags, { f[1], f[2] }) | ||
if f[1]:upper() ~= f[1] then | ||
table.insert(flags, { hide=true, f[1]:upper(), f[2] }) | ||
end | ||
end | ||
end | ||
|
||
-- luacheck: no max line length | ||
clink.argmatcher("where") | ||
:setflagsanywhere(false) | ||
:_addexflags(flags) |