Skip to content

Latest commit

 

History

History
75 lines (52 loc) · 2.45 KB

x-man-page_URL_Scheme.md

File metadata and controls

75 lines (52 loc) · 2.45 KB

The x-man-page: URL Scheme

The x-man-page: scheme has been supported by Terminal.app since at least Mac OS X 10.3 Panther, though there doesn't appear to be any official documentation for the scheme. There are two versions of x-man-page: URLs: man page lookup and apropos keyword search. ManOpen supports the x-man-page: scheme. The ManOpenURLHandlerCommand class implements the x-man-page: support.

man Page Lookup

The man page lookup URL has the format:

x-man-page://<section>/<name>

where <section> is the optional manual section number and <name> is the man page name to look up. Examples of man page lookup, using the open command in a terminal window:

open "x-man-page://1/printf"
open "x-man-page:///grep"

The Terminal.app allows a variable number of slashes before the <name> portion of the URL, but requires exactly two slashes before the <section>. All these variations are accepted:

# with section and name
open "x-man-page://1/printf"
open "x-man-page://1//printf"
open "x-man-page://1///printf"

# with name only
open "x-man-page:/grep"
open "x-man-page://grep"
open "x-man-page:///grep"
open "x-man-page:////grep"

apropos Keyword Search

The apropos keyword search URL has the format:

x-man-page:///<keyword>;type=a

where <keyword> is the keyword to search for. Examples of apropos keyword search, using the open command in a terminal window:

open "x-man-page:///print;type=a"
open "x-man-page:///regex;type=a"

The Terminal.app allows one or more slashes before the <keyword> part of the URL. All of these variations are accepted:

open "x-man-page:///regex;type=a"
open "x-man-page:/regex;type=a"

A <section> can be given for apropos search URLs, but is ignored.

# section "1" is ignored
open "x-man-page://1/print;type=a"

x-man-page: Scheme References

Sources of information on the x-man-page scheme: