alt_getopt.lua: allow `?` as an option

This makes it possible to call `script -?`
develop
Timur Kelman 2021-08-21 13:39:10 +02:00 committed by GitHub
parent c5509bb76f
commit ca8d89df5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

@ -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