Skip to content

Commit 7e4715c

Browse files
author
Peter Spiess-Knafl
committed
updating manpage
1 parent e66e979 commit 7e4715c

File tree

1 file changed

+61
-8
lines changed

1 file changed

+61
-8
lines changed

doc/manpage

Lines changed: 61 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,79 @@
11
.\" Manpage for jsonrpcstub.
2-
.\" Contact [email protected] to correct errors or typos.
3-
.TH man 1 "06 May 2010" "0.4" "jsonrpcstub man page"
2+
.\" Contact [email protected] to correct errors or typos.
3+
.TH man 1 "22 November 2014" "0.4" "jsonrpcstub man page"
44
.SH NAME
55
jsonrpcstub \- genearate stubs for the libjson\-rpc\-cpp framework.
66
.SH SYNOPSIS
77
.B
8-
jsonrpcstub specfile.json [\-\-cpp\-server=namespace::ClassName]
9-
[\-\-cpp\-server\-file=classname.h] [\-\-cpp\-client=namespace::ClassName]
10-
[\-\-cpp\-client-file=classname.h] [\-\-js\-client=ClassName]
11-
[\-\-js-client-file=classname.js] [\-h] [\-v]
8+
jsonrpcstub specfile.json [\-\-cpp\-server=namespace::ClassName]
9+
[\-\-cpp\-server\-file=classqname.h] [\-\-cpp\-client=namespace::ClassName]
10+
[\-\-cpp\-client-file=classname.h] [\-\-js\-client=ClassName]
11+
[\-\-js-client-file=classname.js] [\-h] [\-v]
1212
.PP
1313

1414
.SH DESCRIPTION
1515
.PP
1616
jsonrpcstub is a tool to generate C++ and JavaScript classes from a procedure specification file.
17+
.SS SPECIFICATION SYNTAX
18+
.PP
19+
The specifictaion file is a JSON file containing all available JSON-RPC methods and notifications
20+
with their corresponding parameters and return values contained in a top-level JSON array.
21+
.PP
22+
.nf
23+
[
24+
{
25+
"name": "method_with_positional_params",
26+
"params": [3,4],
27+
"returns": 7
28+
},
29+
{
30+
"name": "methid_with_named_params",
31+
"params": {"param1": 3, "param2": 4},
32+
"returns": 7
33+
},
34+
{
35+
"name": "notification_without_parmas"
36+
}
37+
]
38+
.fi
1739

40+
.PP
41+
The literal in each \fB"params"\fP and \fB"returns"\fP section defines the corresponding type.
42+
If the \fb"params"\fP contains an array, the parameters are accepted by position,
43+
if it contains an object, they are accepted by name.
44+
.SH OPTIONS
45+
.IP -h
46+
Print usage information.
47+
.IP -v
48+
Print verbose information during generation.
49+
.IP --cpp-server=ClassName
50+
Creates a Abstract Server class. Namespaces can be provided using the :: notation
51+
(e.g. ns1::ns2::Classname).
52+
.IP --cpp-server-file=filename.h
53+
Defines the filename to use when generating the C++ Abstract Server class.
54+
If this is not provided, the lowercase classname is used.
55+
.IP --cpp-client=ClassName
56+
Creates a C++ client class. Namespaces can be provided using the :: notation
57+
(e.g. ns1::ns2::Classname).
58+
.IP --cpp-client-file=filename.h
59+
Defines the filename to use when generating the C++ client class.
60+
If this is not provided, the lowercase classname is used.
61+
.IP --js-client=ClassName
62+
Creates a JavaScript client class. No namespaces are supported in this option.
63+
.IP --js-client-file=filename.js
64+
Defines the filename to use when generating the JavaScrip client class.
1865
.SH EXAMPLES
1966
.PP
2067
Generate C++ Stubs for Server and Client, the classes will be named AbstractStubServer and StubClient:
68+
.P P
69+
.B
70+
\& jsonrpcstub spec.json --cpp--server=AbstractStubServer --cpp-client=StubClient
71+
.B
72+
.PP
73+
Generate JavaScript Client class MyRpcClient into file someclient.js:
2174
.PP
2275
.B
23-
\& jsonrpcstub <spec.json> --cpp--server=AbstractStubServer<abstractserverstub.h> --cpp-client=StubClient
76+
\& jsonrpcstub spec.json --js--client=MyRpcClient --js-client-file=someclient.js
2477
.B
2578
.SH SEE ALSO
2679
https://github.com/cinemast/libjson\-rpc\-cpp
@@ -49,4 +102,4 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR TH
49102
OR OTHER DEALINGS IN THE SOFTWARE.
50103

51104
.SH AUTHOR
52-
Peter Spiess-Knafl ([email protected])
105+
Peter Spiess-Knafl ([email protected])

0 commit comments

Comments
 (0)