From abfd6a99ca77cc5c21544dbd81b49be91eb89af1 Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Thu, 23 Jan 2025 01:21:48 +0900 Subject: [PATCH] optlib2c: make the error message more specific when a wrong datatype is given Signed-off-by: Masatake YAMATO --- misc/optlib2c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/misc/optlib2c b/misc/optlib2c index cf1ee55730..42179edf3d 100755 --- a/misc/optlib2c +++ b/misc/optlib2c @@ -75,10 +75,14 @@ my $fielddef_flags = { $datatype .= "FIELDTYPE_BOOL"; } - elsif (($1 eq 'bool+str') || ($1 eq 'str+bool')) + elsif ($1 eq 'str+bool') { $datatype .= "FIELDTYPE_STRING|FIELDTYPE_BOOL"; } + elsif ($1 eq 'bool+str') + { + die "\"{datatype=$1}\": use str+bool instead of bool+str"; + } else { die "Unknown datatype specification: \"{datatype=$1}\" in \"--_fielddef-=...\"";