-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathremove.lua
More file actions
38 lines (29 loc) · 850 Bytes
/
Copy pathremove.lua
File metadata and controls
38 lines (29 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
--- @since 26.5.6
-- The module to handle the remove command
-- Import the configuration module
local utils_config = require("augment-command")
-- The module table
local M = {}
-- The function to handle the remove command
---@type YaziPluginEntry
function M:entry(job)
-- Get the arguments and the configuration
local args, config = utils_config.parse_args_and_init(job)
-- Call the remove command with item group handling
return require(".utils").handle_yazi_command(
"remove",
args,
config,
function(arguments)
-- If the current directory is protected,
-- remove the force flag from the given arguments
if utils_config.current_directory_protected() then
require(".utils").table_pop(arguments, "force")
end
-- Return the modified arguments
return arguments
end
)
end
-- Return the module table
return M