mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-04-12 18:40:23 +08:00
warnings: strip nasmdoc makeup from help strings
When displaying command line help strings, strip nasmdoc markup. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
33ef63669c
commit
d55d22996a
@ -11,13 +11,21 @@ my %prefixes = ();
|
||||
my $err = 0;
|
||||
my $nwarn = 0;
|
||||
|
||||
sub quote_for_c($) {
|
||||
sub quote_for_c(@) {
|
||||
my $s = join('', @_);
|
||||
|
||||
$s =~ s/([\"\'\\])/\\$1/g;
|
||||
return $s;
|
||||
}
|
||||
|
||||
sub remove_markup(@) {
|
||||
my $s = join('', @_);
|
||||
|
||||
$s =~ s/\\[\w+](\{((?:(?>[^{}]+)|(?1))*)\})?/$2/g;
|
||||
$s =~ s/\\(\W)/$1/g;
|
||||
return $s;
|
||||
}
|
||||
|
||||
sub add_alias($$) {
|
||||
my($a, $this) = @_;
|
||||
my @comp = split(/-/, $a);
|
||||
@ -162,7 +170,7 @@ if ($what eq 'c') {
|
||||
$#warnings + 2;
|
||||
print $out "\tNULL";
|
||||
foreach my $warn (@warnings) {
|
||||
my $help = quote_for_c($warn->{help});
|
||||
my $help = quote_for_c(remove_markup($warn->{help}));
|
||||
print $out ",\n\t\"", $help, "\"";
|
||||
}
|
||||
print $out "\n};\n\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user