Skip to content

Commit bb29887

Browse files
committed
Fix escaping of the -manual option
1 parent 89d3685 commit bb29887

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ func writeManPage(w io.Writer, name, description, v string, include *Include, he
531531
fieldEscaper.Replace(v),
532532
)
533533
if manual != "" {
534-
mfprintf(w, " %q", manual)
534+
mfprintf(w, ` "%s"`, fieldEscaper.Replace(manual))
535535
}
536536
mfprintln(w)
537537

testdata/test_full_escapes.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.\" Generated by gohelp2man (devel); DO NOT EDIT.
2-
.TH .BR\(dqCMD 1 1970-01-01 ".br\(dqcmd v3.1.0\-beta.1"
2+
.TH .BR\(dqCMD 1 1970-01-01 ".br\(dqcmd v3.1.0\-beta.1" "\(dqtest\(dq commands"
33
.SH NAME
44
\&.br"cmd \- command that contains a double quote and starts with a dot
55
.SH SYNOPSIS

testdata/test_full_escapes.args

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
-version-string
22
v3.1.0-beta.1
3+
-manual
4+
"test" commands

0 commit comments

Comments
 (0)