From ca8d89df5ad9e6e8c52efb21823aad9faf6073d6 Mon Sep 17 00:00:00 2001 From: Timur Kelman Date: Sat, 21 Aug 2021 13:39:10 +0200 Subject: [PATCH] alt_getopt.lua: allow `?` as an option This makes it possible to call `script -?` --- library/lua/3rdparty/alt_getopt.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/lua/3rdparty/alt_getopt.lua b/library/lua/3rdparty/alt_getopt.lua index df4f51402..f6c2c5bae 100644 --- a/library/lua/3rdparty/alt_getopt.lua +++ b/library/lua/3rdparty/alt_getopt.lua @@ -50,7 +50,7 @@ local function get_opt_map(opts) local len = #opts local options = {} - for short_opt, accept_arg in opts:gmatch('(%w)(:?)') do + for short_opt, accept_arg in opts:gmatch('([%w%?])(:?)') do options[short_opt] = #accept_arg end