- $arg = '@var{' . lc ($arg) . '}';
- $arg = '[' . $arg . ']'
- if $opt eq '[';
- $option{"$long=$arg"} = $short ? "$short $arg" : '';
+ $arg = lc ($arg);
+ # If the argument is compite (e.g., for --define[=NAME[=VALUE]]),
+ # put each word in @var, to build @var{name}[=@var{value}], not
+ # @var{name[=value]}].
+ $arg =~ s/(\w+)/\@var{$1}/g;
+ my $long_arg = "=$arg";
+ if ($opt eq '[') {
+ $long_arg = "[$long_arg]";
+ $arg = "[$arg]";
+ }
+ $option{"$long$long_arg"} = $short ? "$short $arg" : '';