diff options
author | sjg <sjg@FreeBSD.org> | 2015-05-27 01:19:58 +0000 |
---|---|---|
committer | sjg <sjg@FreeBSD.org> | 2015-05-27 01:19:58 +0000 |
commit | 65145fa4c81da358fcbc3b650156dab705dfa34e (patch) | |
tree | 55c065b6730aaac2afb6c29933ee6ec5fa4c4249 /usr.bin/man | |
parent | 60ff4eb0dff94a04d75d0d52a3957aaaf5f8c693 (diff) | |
parent | e6b664c390af88d4a87208bc042ce503da664c3b (diff) | |
download | FreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.zip FreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.tar.gz |
Merge sync of head
Diffstat (limited to 'usr.bin/man')
-rw-r--r-- | usr.bin/man/man.1 | 41 | ||||
-rwxr-xr-x | usr.bin/man/man.sh | 36 |
2 files changed, 59 insertions, 18 deletions
diff --git a/usr.bin/man/man.1 b/usr.bin/man/man.1 index 7517a64..5647b6c 100644 --- a/usr.bin/man/man.1 +++ b/usr.bin/man/man.1 @@ -61,23 +61,32 @@ restricts the search to the specific section of the manual. The sections of the manual are: .Bl -enum -offset indent -compact .It -.Fx General Commands Manual +.Fx +General Commands Manual .It -.Fx System Calls Manual +.Fx +System Calls Manual .It -.Fx Library Functions Manual +.Fx +Library Functions Manual .It -.Fx Kernel Interfaces Manual +.Fx +Kernel Interfaces Manual .It -.Fx File Formats Manual +.Fx +File Formats Manual .It -.Fx Games Manual +.Fx +Games Manual .It -.Fx Miscellaneous Information Manual +.Fx +Miscellaneous Information Manual .It -.Fx System Manager's Manual +.Fx +System Manager's Manual .It -.Fx Kernel Developer's Manual +.Fx +Kernel Developer's Manual .El .Pp Options that @@ -340,17 +349,17 @@ Local configuration files. .Sh SEE ALSO .Xr apropos 1 , .Xr intro 1 , +.Xr locale 1 , +.Xr manpath 1 , +.Xr nroff 1 , +.Xr troff 1 , +.Xr whatis 1 , .Xr intro 2 , .Xr intro 3 , .Xr intro 4 , .Xr intro 5 , +.Xr man.conf 5 , .Xr intro 6 , .Xr intro 7 , .Xr intro 8 , -.Xr intro 9 , -.Xr locale 1 , -.Xr manpath 1 , -.Xr nroff 1 , -.Xr troff 1 , -.Xr whatis 1 , -.Xr man.conf 5 +.Xr intro 9 diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh index 0f6249a..5e4d767 100755 --- a/usr.bin/man/man.sh +++ b/usr.bin/man/man.sh @@ -279,8 +279,7 @@ man_check_for_so() { # Usage: man_display_page # Display either the manpage or catpage depending on the use_cat variable man_display_page() { - local EQN NROFF PIC TBL TROFF REFER VGRIND - local IFS l nroff_dev pipeline preproc_arg tool + local IFS pipeline testline # We are called with IFS set to colon. This causes really weird # things to happen for the variables that have spaces in them. @@ -312,6 +311,39 @@ man_display_page() { return fi + if [ -n "$use_width" ]; then + mandoc_args="-O width=${use_width}" + fi + testline="mandoc -Tlint -Wunsupp 2>/dev/null" + pipeline="mandoc $mandoc_args | $MANPAGER" + + if ! eval "$cattool $manpage | $testline" ;then + if which -s groff; then + man_display_page_groff + else + echo "This manpage needs groff(1) to be rendered" >&2 + echo "First install groff(1): " >&2 + echo "pkg install groff " >&2 + ret=1 + fi + return + fi + + if [ $debug -gt 0 ]; then + decho "Command: $cattool $manpage | $pipeline" + ret=0 + else + eval "$cattool $manpage | $pipeline" + ret=$? + fi +} + +# Usage: man_display_page_groff +# Display the manpage using groff +man_display_page_groff() { + local EQN NROFF PIC TBL TROFF REFER VGRIND + local IFS l nroff_dev pipeline preproc_arg tool + # So, we really do need to parse the manpage. First, figure out the # device flag (-T) we have to pass to eqn(1) and groff(1). Then, # setup the pipeline of commands based on the user's request. |