Changeset

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
parents 13056:c38b1c63aa5c
children 13059:a47bd6ea7626
files util/argparse.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
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