From eab3ca855009594781fb4fd46b2aa7a3422afc03 Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Fri, 13 Sep 2019 08:55:15 +0200 Subject: [PATCH] Fix whatis info in manpage whatis relies on a specific format in the NAME section: command name, hyphen, description. This fixes the generator so that it produces a valid NAME section. Signed-off-by: Stephen Kitt --- doc/mkman.rb | 4 ++-- doc/mlr.1 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/mkman.rb b/doc/mkman.rb index 7260dc71f..642d80124 100755 --- a/doc/mkman.rb +++ b/doc/mkman.rb @@ -17,7 +17,7 @@ def main print make_top print make_section('NAME', [ - "Miller is like awk, sed, cut, join, and sort for name-indexed data such as CSV and tabular JSON." + "miller \\\- like awk, sed, cut, join, and sort for name-indexed data such as CSV and tabular JSON." ]) print make_section('SYNOPSIS', [ @@ -224,7 +224,7 @@ def groff_encode(line) #line = line.gsub(/"/, '\(dq') #line = line.gsub(/\./, '\&') #line = line.gsub(/-/, '\-') - line = line.gsub(/\\/, '\e') + line = line.gsub(/\\([^-])/, '\e\1') line = line.gsub(/^\./){'\&.'} line end diff --git a/doc/mlr.1 b/doc/mlr.1 index 3e6ceabb3..a4ff55922 100644 --- a/doc/mlr.1 +++ b/doc/mlr.1 @@ -26,7 +26,7 @@ .\" ----------------------------------------------------------------- .SH "NAME" .sp -Miller is like awk, sed, cut, join, and sort for name-indexed data such as CSV and tabular JSON. +miller \- like awk, sed, cut, join, and sort for name-indexed data such as CSV and tabular JSON. .SH "SYNOPSIS" .sp Usage: mlr [I/O options] {verb} [verb-dependent options ...] {zero or more file names}