Skip to content

Commit

Permalink
Documentation for -x.
Browse files Browse the repository at this point in the history
  • Loading branch information
fitterhappier committed Oct 15, 2008
1 parent 4c1db3a commit 46a5b28
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 2 deletions.
10 changes: 10 additions & 0 deletions README
Expand Up @@ -25,6 +25,10 @@ processes a plist. If the path given to duti on the command-line is a
directory, duti will apply settings from all valid settings files in that
directory, excluding files whose names begin with '.'.

duti can also print out the default application information for a given
extension (-x). This feature is based on public domain source code posted
by Keith Alperin on the heliumfoot.com blog.

See the man page for additional usage details.


Expand All @@ -41,6 +45,12 @@ See the man page for additional usage details.
Set Finder as the default handler for ftp:// URLs:
% duti -s com.apple.Finder ftp

Get default application information for .jpg files:
% duti -x jpg
Preview
/Applications/Preview.app
com.apple.Preview


* Support

Expand Down
40 changes: 38 additions & 2 deletions duti.1
Expand Up @@ -22,6 +22,9 @@
.I role
]
.sp
.B duti
.BI \-x\ ext
.sp
.SH DESCRIPTION
.B duti
sets applications as default handlers for Apple's Uniform Type Identifiers
Expand All @@ -47,7 +50,15 @@ means that
.B duti
will set the handler for a URL scheme. Three arguments means
.B duti
will set the handler for a UTI. See
will set the handler for a UTI.
.sp
.B duti
.BI \-x
retrieves and prints out information describing the default application
for files with the extension
.IR ext .
.sp
See
.B EXAMPLES
below for usage cases.
.sp
Expand Down Expand Up @@ -190,6 +201,21 @@ with
duti -s com.apple.Finder ftp
.sp

Retrieving default application information for an extension:
.sp
.br
# default application information for .html files
.br
% duti -x html
.br
Safari
.br
/Applications/Safari.app
.br
com.apple.Safari
.br
.sp

The following examples can be used by passing them to
.B duti
on stdin or as lines in a .duti file.
Expand Down Expand Up @@ -235,6 +261,10 @@ print version number and exit.
.TP 19
.B \-v
verbose output.
.TP 19
.BI \-x\ ext
print information describing the default application for extension
.IR ext .
.sp
.SH EXIT STATUS
.TP 5
Expand All @@ -256,10 +286,16 @@ in the Apple Developer Connection Library at:
http://developer.apple.com/referencelibrary/
.br
.sp
More technical information, including APIs, can be found at:
.sp
.br
http://developer.apple.com/macosx/uniformtypeidentifiers.html
.br
.sp
To get a list of UTIs on your system, you can use the following command line:
.sp
.br
`locate lsregister` -dump | grep '[[:space:]]uti:' \\
\`locate lsregister\` -dump | grep '[[:space:]]uti:' \\
.br
| awk '{ print $2 }' | sort | uniq
.sp
Expand Down

0 comments on commit 46a5b28

Please sign in to comment.