From 46623bd0df2d3dedd5d6d97f33c299b9271636eb Mon Sep 17 00:00:00 2001 From: Jackson Moore Date: Sat, 5 Sep 2026 13:54:55 +0200 Subject: Normalize Boolean options --- yazi-enter.yazi/main.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'yazi-enter.yazi/main.lua') diff --git a/yazi-enter.yazi/main.lua b/yazi-enter.yazi/main.lua index 6765576..10ed117 100644 --- a/yazi-enter.yazi/main.lua +++ b/yazi-enter.yazi/main.lua @@ -8,6 +8,17 @@ local function parse_mode(value) 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 commit = ya.sync(function() return 0 end) -- cgit v1.2.3