From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 06:34:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B381106564A; Thu, 7 Oct 2010 06:34:47 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B36D8FC0A; Thu, 7 Oct 2010 06:34:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o976YlEx030727; Thu, 7 Oct 2010 06:34:47 GMT (envelope-from gordon@svn.freebsd.org) Received: (from gordon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o976YlOG030724; Thu, 7 Oct 2010 06:34:47 GMT (envelope-from gordon@svn.freebsd.org) Message-Id: <201010070634.o976YlOG030724@svn.freebsd.org> From: Gordon Tetlow Date: Thu, 7 Oct 2010 06:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213507 - head/usr.bin/man X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 06:34:47 -0000 Author: gordon Date: Thu Oct 7 06:34:47 2010 New Revision: 213507 URL: http://svn.freebsd.org/changeset/base/213507 Log: Add the ability to display specific manual pages if passed on the commandline. This mirrors the old (undocumented) GNU man functionality. Also document this feature in the implementation notes section of the manpage. Submitted by: arundel Approved by: wes (mentor implicit) Modified: head/usr.bin/man/man.1 head/usr.bin/man/man.sh Modified: head/usr.bin/man/man.1 ============================================================================== --- head/usr.bin/man/man.1 Thu Oct 7 00:37:40 2010 (r213506) +++ head/usr.bin/man/man.1 Thu Oct 7 06:34:47 2010 (r213507) @@ -225,6 +225,13 @@ will search the following paths when con .It .Pa /usr/share/man/man4 .El +.Ss Displaying Specific Manual Files +The +.Nm +utility also supports displaying a specific manual page if passed a path +to the file as long as it contains a +.Sq / +character. .Sh ENVIRONMENT The following environment variables affect the execution of .Nm : Modified: head/usr.bin/man/man.sh ============================================================================== --- head/usr.bin/man/man.sh Thu Oct 7 00:37:40 2010 (r213506) +++ head/usr.bin/man/man.sh Thu Oct 7 06:34:47 2010 (r213507) @@ -356,6 +356,20 @@ man_display_page() { man_find_and_display() { local found_page locpath p path sect + # Check to see if it's a file. But only if it has a '/' in + # the filename. + case "$1" in + */*) if [ -f "$1" -a -r "$1" ]; then + decho "Found a usable page, displaying that" + found_page=yes + unset use_cat + manpage="$1" + man_display_page + return + fi + ;; + esac + IFS=: for sect in $MANSECT; do decho "Searching section $sect" 2