Man page for package display format in search commands. #254

This commit is contained in:
Andrey Smirnov
2015-07-04 13:02:33 +03:00
parent 8bda799545
commit ba4669a9c4
2 changed files with 59 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "APTLY" "1" "May 2015" "" ""
.TH "APTLY" "1" "July 2015" "" ""
.
.SH "NAME"
\fBaptly\fR \- Debian repository management tool
@@ -314,6 +314,24 @@ When specified on command line, query may have to be quoted according to shell r
.P
\fBaptly repo import percona stable \(cqmysql\-client (>= 3\.6)\(cq\fR
.
.SH "PACKAGE DISPLAY FORMAT"
Some aptly commands (\fBaptly mirror search\fR, \fBaptly package search\fR, \|\.\|\.\|\.) support \fB\-format\fR flag which allows to customize how search results are printed\. Golang templates are used to specify display format, with all package stanza fields available to template\. In addition to package stanza fields aptly provides:
.
.TP
\fBKey\fR
internal aptly package ID, unique for all packages in aptly (combination of \fBShortKey\fR and \fBFilesHash\fR)\.
.
.TP
\fBFilesHash\fR
hash that includes MD5 of all packages files\.
.
.TP
\fBShortKey\fR
package ID, which is unique in single list (mirror, repo, snapshot, \|\.\|\.\|\.), but not unique in whole aptly package collection\.
.
.P
For example, default aptly display format could be presented with the following template: \fB{{\.Package}}_{{\.Version}}_{{\.Architecture}}\fR\. To display package name with dependencies: \fB{{\.Package}} | {{\.Depends}}\fR\. More information on Golang template syntax: http://godoc\.org/text/template
.
.SH "GLOBAL OPTIONS"
.
.TP
@@ -547,6 +565,10 @@ $ aptly mirror search wheezy\-main \(cq$Architecture (i386), Name (% *\-dev)\(cq
Options:
.
.TP
\-\fBformat\fR=
custom format for result printing
.
.TP
\-\fBwith\-deps\fR=false
include dependencies into search results
.
@@ -812,6 +834,10 @@ $ aptly repo search my\-software \(cq$Architecture (i386), Name (% *\-dev)\(cq
Options:
.
.TP
\-\fBformat\fR=
custom format for result printing
.
.TP
\-\fBwith\-deps\fR=false
include dependencies into search results
.
@@ -1102,6 +1128,10 @@ $ aptly snapshot search wheezy\-main \(cq$Architecture (i386), Name (% *\-dev)\(
Options:
.
.TP
\-\fBformat\fR=
custom format for result printing
.
.TP
\-\fBwith\-deps\fR=false
include dependencies into search results
.
@@ -1518,6 +1548,13 @@ $ aptly package search \(cq$Architecture (i386), Name (% *\-dev)\(cq
.
.IP "" 0
.
.P
Options:
.
.TP
\-\fBformat\fR=
custom format for result printing
.
.SH "SHOW DETAILS ABOUT PACKAGES MATCHING QUERY"
\fBaptly\fR \fBpackage\fR \fBshow\fR \fIpackage\-query\fR
.

View File

@@ -274,6 +274,27 @@ When specified on command line, query may have to be quoted according to shell r
`aptly repo import percona stable 'mysql-client (>= 3.6)'`
## PACKAGE DISPLAY FORMAT
Some aptly commands (`aptly mirror search`, `aptly package search`, ...) support `-format` flag
which allows to customize how search results are printed. Golang templates are used to specify
display format, with all package stanza fields available to template. In addition to package stanza
fields aptly provides:
* `Key`:
internal aptly package ID, unique for all packages in aptly
(combination of `ShortKey` and `FilesHash`).
* `FilesHash`:
hash that includes MD5 of all packages files.
* `ShortKey`:
package ID, which is unique in single list (mirror, repo, snapshot, ...), but not unique
in whole aptly package collection.
For example, default aptly display format could be presented with the following template:
`{{"{{"}}.Package{{"}}"}}_{{"{{"}}.Version{{"}}"}}_{{"{{"}}.Architecture{{"}}"}}`. To display package name with dependencies:
`{{"{{"}}.Package{{"}}"}} | {{"{{"}}.Depends{{"}}"}}`. More information on Golang template syntax: http://godoc.org/text/template
## GLOBAL OPTIONS