'\" t
.\"     Title: CAPNPROTO
.\"    Author: Tom Lee <debian@tomlee.co>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\"      Date: 02/05/2019
.\"    Manual: capnp User Manual
.\"    Source: capnp
.\"  Language: English
.\"
.TH "CAPNPROTO" "1" "02/05/2019" "capnp" "capnp User Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
capnp \- compiler for Cap\*(Aqn Proto data interchange format definition files
.SH "SYNOPSIS"
.HP \w'\fBcapnp\fR\ 'u
\fBcapnp\fR [\fI<options>\fR] \fI<command>\fR [\fI<args>\fR]
.HP \w'\fBcapnp\fR\ 'u
\fBcapnp\fR id
.HP \w'\fBcapnp\fR\ 'u
\fBcapnp\fR [\fB\-\-help\fR | \fB\-\-version\fR]
.SH "DESCRIPTION"
.PP
This manual page documents briefly the
\fBcapnp\fR
command\&.
.PP
It was written for the Debian distribution because the original program does not have a manual page\&.
.PP
\fBcapnp\fR
is wrapper for various tools used to manipulate the Cap\*(Aqn Proto data interchange format\&. These tools include a definition file compiler, a C++ backend, a decoder for converting Cap\*(Aqn Proto messages to text and a generator for Cap\*(Aqn Proto definition IDs\&.
.SH "OPTIONS"
.PP
The program follows the usual GNU command line syntax, with long options starting with two dashes (`\-\*(Aq)\&. A summary of options is included below\&.
.PP
\fB\-I\fR\fB\fIDIR\fR\fR, \fB\-\-import\-path\fR\fB\fIDIR\fR\fR
.RS 4
Add DIR to the list of directories searched for non\-relative imports (ones that start with a \*(Aq/\*(Aq)\&.
.RE
.PP
\fB\-\-no\-standard\-import\fR
.RS 4
Do not add any default import paths; use only those specified by \-I\&. Otherwise, typically /usr/include and /usr/local/include are added by default\&.
.RE
.PP
\fB\-\-verbose\fR
.RS 4
Log informational messages to stderr; useful for debugging\&.
.RE
.PP
\fB\-\-help\fR
.RS 4
Show summary of options\&.
.RE
.PP
\fB\-\-version\fR
.RS 4
Show version of program\&.
.RE
.SH "COMMANDS"
.SS "compile"
.PP
Compile Cap\*(Aqn Proto schema files & generate corresponding source code in one or more languages\&.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBOPTIONS\fR
.RS 4
.PP
\fB\-I\fR\fB\fI<dir>\fR\fR, \fB\-\-import\-path=\fR\fB\fI<dir>\fR\fR
.RS 4
Add <dir> to the list of directories searched for non\-relative imports (ones that start with a \*(Aq/\*(Aq)\&.
.RE
.PP
\fB\-\-no\-standard\-import\fR
.RS 4
Do not add any default import paths; use only those specified by \-I\&. Otherwise, typically /usr/include and /usr/local/include are added by default\&.
.RE
.PP
\fB\-o\fR\fB\fIlang[:\fR\fI\fIdir\fR\fR\fI]\fR\fR, \fB\-\-output=\fR\fB\fIlang[:\fR\fI\fIdir\fR\fR\fI]\fR\fR
.RS 4
Generate source code for language <lang> in directory <dir> (default: current directory)\&. <lang> actually specifies a plugin to use\&. If <lang> is a simple word, the compiler for a plugin called \*(Aqcapnpc\-<lang>\*(Aq in $PATH\&. If <lang> is a file path containing slashes, it is interpreted as the exact plugin executable file name, and $PATH is not searched\&.
.RE
.PP
\fB\-\-src\-prefix=\fR\fB\fI<prefix>\fR\fR
.RS 4
If a file specified for compilation starts with <prefix>, remove the prefix for the purpose of deciding the names of output files\&. For example, the following command: capnp \-\-src\-prefix=foo/bar \-oc++:corge foo/bar/baz/qux\&.capnp would generate the files corge/baz/qux\&.capnp\&.{h,c++}\&.
.RE
.RE
.SS "decode"
.PP
Decodes one or more encoded Cap\*(Aqn Proto messages as text\&. Messages are read from standard input and by default are expected to be in standard Cap\*(Aqn Proto serialization format\&.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBOPTIONS\fR
.RS 4
.PP
\fB\-I\fR\fB\fI<dir>\fR\fR, \fB\-\-import\-path=\fR\fB\fI<dir>\fR\fR
.RS 4
Add <dir> to the list of directories searched for non\-relative imports (ones that start with a \*(Aq/\*(Aq)\&.
.RE
.PP
\fB\-f\fR, \fB\-\-flat\fR
.RS 4
Interpret the input as one large single\-segment message rather than a stream in standard serialization format\&.
.RE
.PP
\fB\-\-no\-standard\-import\fR
.RS 4
Do not add any default import paths; use only those specified by \-I\&. Otherwise, typically /usr/include and /usr/local/include are added by default\&.
.RE
.PP
\fB\-p\fR, \fB\-\-packed\fR
.RS 4
Expect the input to be packed using standard Cap\*(Aqn Proto packing, which deflates zero\-valued bytes\&.
.RE
.PP
\fB\-\-short\fR
.RS 4
Print in short (non\-pretty) format\&. Each message will be printed on one line, without using whitespace to improve readability\&.
.RE
.RE
.SS "id"
.PP
Generates a unique identifier for Cap\*(Aqn Proto schema files\&.
.SH "SEE ALSO"
.PP
More documentation about Cap\*(Aqn Proto is available online at
\m[blue]\fB\%http://capnproto.org\fR\m[]\&.
.SH "AUTHOR"
.PP
\fBTom Lee\fR <\&debian@tomlee\&.co\&>
.RS 4
Wrote this manpage for the Debian system\&.
.RE
.SH "COPYRIGHT"
.br
Copyright \(co 2013 Tom Lee
.br
.PP
This manual page was written for the Debian system (and may be used by others)\&.
.PP
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or (at your option) any later version published by the Free Software Foundation\&.
.PP
On Debian systems, the complete text of the GNU General Public License can be found in
/usr/share/common\-licenses/GPL\&.
.sp
