summaryrefslogtreecommitdiff
path: root/yazi-enter.yazi/main.lua
blob: 55a58bc0ca85f0ead75c5c0aaaea38562e5a31a9 (plain)
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
--- @since 26.9.1

local function parse_mode(value)
	if value == "directory" or value == "file" or value == "either" then
		return value
	end

	error("yazi-enter: mode must be directory, file, or either", 0)
end

local function normalize_boolean(name, value)
	if value == nil or value == false or value == "no" then
		return false
	end
	if value == true or value == "yes" then
		return true
	end

	error(("yazi-enter: option --%s must be true, false, 'yes', or 'no'"):format(name), 0)
end

local function normalize_options(args)
	return normalize_boolean("previous", args.previous),
		normalize_boolean("smart", args.smart),
		normalize_boolean("insensitive", args.insensitive)
end

local commit = ya.sync(function()
	return 0
end)

return {
	entry = function() end,
}