Diff

util/argparse.lua @ 13058:766152afc1c9

util.argparse: Translate '-' to '_' in long option names for convenience A review of existing code suggests nothing will break. So, here we go...
author Matthew Wild <mwild1@gmail.com>
date Fri, 07 Apr 2023 13:24:29 +0100
parent 12477:cc84682b8429
child 13160:4ee9a912ceea
line wrap: on
line diff
--- a/util/argparse.lua	Thu Apr 28 20:40:59 2022 +0200
+++ b/util/argparse.lua	Fri Apr 07 13:24:29 2023 +0100
@@ -44,6 +44,7 @@
 					param_k, param_v = param, true;
 				end
 			end
+			param_k = param_k:gsub("%-", "_");
 		end
 		parsed_opts[param_k] = param_v;
 	end