Skip to content

Commit

Permalink
update man page to fix layout issue
Browse files Browse the repository at this point in the history
  • Loading branch information
genivia-inc committed Dec 5, 2023
1 parent 67ae63c commit ba3901f
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 62 deletions.
34 changes: 25 additions & 9 deletions man.sh
Expand Up @@ -15,27 +15,43 @@ mkdir -p man
echo '.TH UGREP-INDEXER "1" "'`date '+%B %d, %Y'`'" "ugrep-indexer '$1'" "User Commands"' > man/ugrep-indexer.1
cat >> man/ugrep-indexer.1 << 'END'
.SH NAME
\fBugrep-indexer\fR -- file indexer for accelerated ugrep search
\fBugrep-indexer\fR -- file indexer to accelerate recursive searching
.SH SYNOPSIS
.B ugrep-indexer [\fB-0\fR|...|\fB-9\fR] [\fB-.\fR] [\fB-c\fR|\fB-d\fR|\fB-f\fR] [\fB-I\fR] [\fB-q\fR] [\fB-S\fR] [\fB-s\fR] [\fB-X\fR] [\fB-z\fR]
.B ugrep-indexer [\fIPATH\fR] [\fB-0\fR...\fB9\fR] [\fB-c\fR|\fB-d\fR|\fB-f\fR] [\fB-I\fR] [\fB-q\fR] [\fB-S\fR] [\fB-s\fR] [\fB-X\fR] [\fB-z\fR]
.SH DESCRIPTION
The \fBugrep-indexer\fR utility recursively indexes files to accelerate ugrep
recursive searches with \fBugrep\fR option \fB--index\fR.
.PP
An optional \fIPATH\fR may be specified to the root of the directory tree to
index. The default is to recursively index the working directory tree.
.PP
Indexes are incrementally updated unless option \fB-f\fR or \fB--force\fR is
specified.
.PP
When option \fB-I\fR or \fB--ignore-binary\fR is specified, binary files are
ignored and not indexed. Searching with `ugrep --index' still searches binary
files unless ugrep option \fB-I\fR or \fB--ignore-binary\fR is specified also.
.PP
Archives and compressed files are incrementally indexed only when option
\fB-z\fR or \fB--decompress\fR is specified. Otherwise, archives and
compressed files are indexed as binary files, or are ignored with option
\fB-I\fR or \fB--ignore-binary\fR.
.PP
To create an indexing log file, specify option \fB-v\fR or \fB--verbose\fR and
redirect standard output to a log file. All messages are sent to standard
output.
.PP
The following options are available:
END
src/ugrep-indexer --help \
| tail -n+2 \
| tail -n+24 \
| sed -e 's/\([^\\]\)\\/\1\\\\/g' \
| sed \
-e '/^$/ d' \
-e '/^ Long options may start/ d' \
-e '/^ The ugrep-indexer/ d' \
-e '/^ 0 / d' \
-e '/^ 1 / d' \
-e '/^ >1 / d' \
-e '/^ If -q or --quiet or --silent/ d' \
-e '/^ status is 0 even/ d' \
-e '/^ 0 / d' \
-e '/^ 1 / d' \
-e 's/^ \{5,\}//' \
-e 's/^\.\([A-Za-z]\)/\\\&.\1/g' \
-e $'s/^ \(.*\)$/.TP\\\n\\1/' \
Expand All @@ -56,7 +72,7 @@ The \fBugrep-indexer\fR utility exits with one of the following values:
.IP 0
Indexes are up to date.
.IP 1
Indexing check with option \fB-c\fR detected missing and outdated index files.
Indexing check \fB-c\fR detected missing and outdated index files.
.SH EXAMPLES
Recursively and incrementally index all non-binary files showing progress:
.IP
Expand Down
58 changes: 22 additions & 36 deletions man/ugrep-indexer.1
@@ -1,18 +1,32 @@
.TH UGREP-INDEXER "1" "December 05, 2023" "ugrep-indexer 0.9.2" "User Commands"
.SH NAME
\fBugrep-indexer\fR -- file indexer for accelerated ugrep search
\fBugrep-indexer\fR -- file indexer to accelerate recursive searching
.SH SYNOPSIS
.B ugrep-indexer [\fB-0\fR|...|\fB-9\fR] [\fB-.\fR] [\fB-c\fR|\fB-d\fR|\fB-f\fR] [\fB-I\fR] [\fB-q\fR] [\fB-S\fR] [\fB-s\fR] [\fB-X\fR] [\fB-z\fR]
.B ugrep-indexer [\fIPATH\fR] [\fB-0\fR...\fB9\fR] [\fB-c\fR|\fB-d\fR|\fB-f\fR] [\fB-I\fR] [\fB-q\fR] [\fB-S\fR] [\fB-s\fR] [\fB-X\fR] [\fB-z\fR]
.SH DESCRIPTION
The \fBugrep-indexer\fR utility recursively indexes files to accelerate ugrep
recursive searches with \fBugrep\fR option \fB--index\fR.
.PP
An optional \fIPATH\fR may be specified to the root of the directory tree to
index. The default is to recursively index the working directory tree.
.PP
Indexes are incrementally updated unless option \fB-f\fR or \fB--force\fR is
specified.
.PP
When option \fB-I\fR or \fB--ignore-binary\fR is specified, binary files are
ignored and not indexed. Searching with `ugrep --index' still searches binary
files unless ugrep option \fB-I\fR or \fB--ignore-binary\fR is specified also.
.PP
Archives and compressed files are incrementally indexed only when option
\fB-z\fR or \fB--decompress\fR is specified. Otherwise, archives and
compressed files are indexed as binary files, or are ignored with option
\fB-I\fR or \fB--ignore-binary\fR.
.PP
To create an indexing log file, specify option \fB-v\fR or \fB--verbose\fR and
redirect standard output to a log file. All messages are sent to standard
output.
.PP
The following options are available:
Usage:
ugrep\-indexer [\fB\-0\fR|...|\fB\-9\fR] [\fB\-.\fR] [\fB\-c\fR|\fB\-d\fR|\fB\-f\fR] [\fB\-I\fR] [\fB\-q\fR] [\fB\-S\fR] [\fB\-s\fR] [\fB\-X\fR] [\fB\-z\fR] [\fIPATH\fR]
.TP
PATH Optional pathname to the root of the directory tree to index. The
default is to recursively index the working directory tree.
.TP
\fB\-0\fR, \fB\-1\fR, \fB\-2\fR, \fB\-3\fR, ..., \fB\-9\fR, \fB\-\-accuracy\fR=\fIDIGIT\fR
Specifies indexing accuracy. A low accuracy reduces the indexing
Expand Down Expand Up @@ -84,40 +98,12 @@ effectively ignored. Specify \fB\-\-zmax\fR=2 to index compressed files
and archives stored in cpio, pax, tar and zip archives. NUM may
range from 1 to 99 for up to 99 decompression and de\-archiving
steps. Increasing NUM values gradually degrades performance.
.TP
Indexes are incrementally updated unless option \fB\-f\fR or \fB\-\-force\fR is specified.
.TP

.TP
When option \fB\-I\fR or \fB\-\-ignore\-binary\fR is specified, binary files are ignored
.TP
and not indexed. Searching with ugrep \fB\-\-index\fR still searches binary files
.TP
unless ugrep option \fB\-I\fR or \fB\-\-ignore\-binary\fR is specified also.
.TP

.TP
Archives and compressed files are incrementally indexed only when option \fB\-z\fR
.TP
or \fB\-\-decompress\fR is specified. Otherwise, archives and compressed files are
.TP
indexed as binary files, or are ignored with option \fB\-I\fR or \fB\-\-ignore\-binary\fR.
.TP

.TP
To create an indexing log file, specify option \fB\-v\fR or \fB\-\-verbose\fR and redirect
.TP
standard output to a log file. All messages are sent to standard output.
.TP

.TP

.SH "EXIT STATUS"
The \fBugrep-indexer\fR utility exits with one of the following values:
.IP 0
Indexes are up to date.
.IP 1
Indexing check with option \fB-c\fR detected missing and outdated index files.
Indexing check \fB-c\fR detected missing and outdated index files.
.SH EXAMPLES
Recursively and incrementally index all non-binary files showing progress:
.IP
Expand Down
36 changes: 19 additions & 17 deletions src/ugrep-indexer.cpp
Expand Up @@ -523,6 +523,21 @@ void version()
void help()
{
std::cout << "\nUsage:\n\nugrep-indexer [-0|...|-9] [-.] [-c|-d|-f] [-I] [-q] [-S] [-s] [-X] [-z] [PATH]\n\n\
Updates indexes incrementally unless option -f or --force is specified.\n\
\n\
When option -I or --ignore-binary is specified, binary files are ignored\n\
and not indexed. Searching with ugrep --index still searches binary files\n\
unless ugrep option -I or --ignore-binary is specified also.\n\
\n\
Archives and compressed files are incrementally indexed only when option -z\n\
or --decompress is specified. Otherwise, archives and compressed files are\n\
indexed as binary files, or are ignored with option -I or --ignore-binary.\n\
\n\
To create an indexing log file, specify option -v or --verbose and redirect\n\
standard output to a log file. All messages are sent to standard output.\n\
\n\
The following options are available:\n\
\n\
PATH Optional pathname to the root of the directory tree to index. The\n\
default is to recursively index the working directory tree.\n\n\
-0, -1, -2, -3, ..., -9, --accuracy=DIGIT\n\
Expand Down Expand Up @@ -612,24 +627,11 @@ void help()
"\
This option is not available in this build configuration of ugrep.\n"
#endif
"\n\
Indexes are incrementally updated unless option -f or --force is specified.\n\
\n\
When option -I or --ignore-binary is specified, binary files are ignored\n\
and not indexed. Searching with ugrep --index still searches binary files\n\
unless ugrep option -I or --ignore-binary is specified also.\n\
\n\
Archives and compressed files are incrementally indexed only when option -z\n\
or --decompress is specified. Otherwise, archives and compressed files are\n\
indexed as binary files, or are ignored with option -I or --ignore-binary.\n\
\n\
To create an indexing log file, specify option -v or --verbose and redirect\n\
standard output to a log file. All messages are sent to standard output.\n\
\n\
"\n\
The ugrep-indexer utility exits with one of the following values:\n\
0 Indexes are up to date.\n\
1 Some indexes appear to be stale and are outdated or missing.\n\
\n";
0 Indexes are up to date.\n\
1 Indexing check -c detected missing and outdated index files.\n\
\n";

exit(EXIT_SUCCESS);
}
Expand Down

0 comments on commit ba3901f

Please sign in to comment.