Commit Graph

38 Commits

Author SHA1 Message Date
christos
bc93b1e8f9 Don't enumerate all the digit sections
Explain limitations in legacy mode
2013-03-29 20:17:19 +00:00
christos
cb0641eb5a - If the stdout is not a tty, prevent formatting unless forced with -i
- Don't ever page unless asked for with -p
- Introduce "legacy mode" (-l)
  1. searches only name and name_desc, prints name(section) - name_description
  2. turns off escape formatting (can be forced on with -i)
  3. turns off context printing (can be forced on with -c)
- Parse the environment $APROPOS variable as an argument vector.

With these changes one can simply 'export APROPOS=-l' and get the old apropos
behavior.
2013-03-29 20:07:31 +00:00
christos
9d0d34e51f add -r flag to elide tty formatting 2013-02-10 23:58:27 +00:00
christos
9d8fe63b1b remove trailing whitespace 2013-02-10 23:24:18 +00:00
christos
6265ee0d3c - move the terminal handling in apropos-utils.c since htmp and pager are also
handled there.
- underline the name, section, and description so that it is prettier.
- change to bold terminal the terminal highlighting to match with less
2013-01-14 21:26:25 +00:00
christos
ee0ec621f0 Fix the #ifdef NOTYET, namely use the terminal standout mode to highlight the
search terms.
2013-01-14 18:04:58 +00:00
christos
cc03b84d06 Since mdocml decided to name headers that conflict with system ones (term.h)
move the header inclusion one up.
2013-01-14 18:01:59 +00:00
christos
98f3134321 If you cannot parse .SH NAME, like in the case of the ksh93 man page
where the .SH is followed by a conditional:

.SH NAME
.if \nZ=0 \{\
text text text
.\}

at least don't core-dump.
2012-11-08 19:17:54 +00:00
wiz
b1203a9851 Make mandb path configurable. makemandb (and related tools) use
the path from the _mandb variable from man.conf now.

Set _mandb in man.conf to same value as was used before.

From Abhinav Upadhyay <er.abhinav.upadhyay@gmail.com>.
2012-10-06 15:33:59 +00:00
wiz
43eaa46ea3 Use emalloc in one more place, like the rest of the code does.
From Abhinav Upadhyay <er.abhinav.upadhyay@gmail.com>.
2012-09-07 11:29:04 +00:00
wiz
ab20ab348a Fix usage, from Abhinav Upadhyay <er.abhinav.upadhyay@gmail.com>. 2012-09-07 11:28:46 +00:00
wiz
e93044e5ab Add -Q flag:
Print only fatal error messages (i.e., when the database is left in
an inconsistent state and needs manual intervention).

From Abhinav Upadhyay <er.abhinav.upadhyay@gmail.com>.
2012-08-29 20:33:01 +00:00
wiz
3450e15562 Sync usage with manpage. 2012-08-25 12:37:12 +00:00
wiz
6110b05d8f Sort options in SYNOPSIS. 2012-08-25 12:37:00 +00:00
wiz
ae90bf6a58 Bug fix for PR 46733:
> makemandb always reports the same number for "Total Number of new or
 > updated pages enountered" and "Total number of (hard or symbolic)
 > links found".

Patch from Abhinav Upadhyay.
2012-08-11 21:07:13 +00:00
uwe
4b084fb4d9 Fix typo in a message. 2012-07-08 23:18:23 +00:00
joerg
52222de363 KNF 2012-05-10 15:36:09 +00:00
wiz
d099c69274 PR 46419 by Abhinav Upadhyay using his updated patch:
Clean up after removing man page aliases.
2012-05-07 11:18:16 +00:00
wiz
66c3a8d39a The new apropos(1) incorrectly displays hyphens in the first line
of the search results for a few man pages (for man(7) based man
pages).

Use patch from Abhinav Upadhyay in PR 46408 to fix this.
2012-05-04 23:50:26 +00:00
wiz
7ee504a202 Sync with reality, From Abhinav Upadhyay in private mail. 2012-04-22 21:29:27 +00:00
wiz
1c81341419 Add HISTORY section. From Abhinav Upadhyay in private mail. 2012-04-22 21:27:07 +00:00
wiz
f41e473d4b Handle pages with slashes in their names better.
From Abhinav Upadhyay in private mail.
2012-04-15 15:56:52 +00:00
apb
d0663c218f Add the result from sqlite3_errmsg() to some error messages.
Now we can get "apropos: Unable to query schema version: database is locked"
instead of just "apropos: Unable to query schema version".
2012-04-07 10:44:58 +00:00
joerg
51bb6fdd57 Fix inverted condition when handling stale entries.
From Abhinav Upadhyay.
2012-03-02 15:09:58 +00:00
joerg
e9d4b22f91 Expand workaround for .so usage to do the chdir call just before
starting parsing, not during the tree iteration. This gives it a chance
to work.
2012-02-27 16:51:06 +00:00
joerg
50a2d17c77 SQLite doesn't use the FTS index for equal ops, so force it to do a FTS
search first. Drops run time by a factor of 6 for "whatis man".
Found by Abhinav Upadhyay.
2012-02-20 18:27:30 +00:00
joerg
fdbd00e5b0 Add reference to whatis(1). From Abhinav Upadhyay. 2012-02-20 18:25:51 +00:00
joerg
bdc4335e48 Add support for compressed man pages in all the usual formats. 2012-02-16 20:58:55 +00:00
joerg
56cd811802 Add support for apropos -s like in the old apropos. Fix capitalisation.
Add note about optional quotation. From Abhinav Upadhyay.
2012-02-15 23:53:13 +00:00
joerg
c701d37453 Also handle hyphen replacement if it was used as plain input and no
backslash sequence was used at all in the line.
2012-02-15 23:36:10 +00:00
joerg
79cdc1651d Be a bit more friendly to man pages using the roff .so command by
changing the current directory to the parent of the man -p entry, e.g.
/usr/share/man for /usr/share/man1.
2012-02-15 23:35:00 +00:00
njoly
ca0e389587 Fix makemandb section. 2012-02-10 16:57:44 +00:00
joerg
c725fe53d5 Kill bad magic invocation. 2012-02-07 23:03:34 +00:00
joerg
ee6ce4b9fa getopt returns int, not char. 2012-02-07 22:59:32 +00:00
wiz
0409c3f975 No leading zeroes in date. 2012-02-07 21:02:33 +00:00
wiz
1507c42b9a No leading zeroes in date. New sentence, new line. 2012-02-07 21:02:23 +00:00
joerg
329b37d502 Fix C&P error with $NetBSD$ 2012-02-07 19:17:16 +00:00
joerg
410d0f4380 Import the new apropos/whatis.
This code has been developed by Abhinav Upadhyay as part of Google's Summer
of Code 2011. It uses libmandoc to parse man pages and builds a Full
Text Index in a SQLite database. The combination of indexing the full
manual page, filtering out stop words and ranking individual matches
based on the section gives a much improved user experience.

The old makewhatis and friends are kept under MKMAKEMANDB=no for now.
2012-02-07 19:13:24 +00:00