forked from IBM/gWhisper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUsage.txt
179 lines (138 loc) · 6.31 KB
/
Usage.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
gWhisper - A gRPC command-line client
https://github.com/IBM/gWhisper
This tool allows to call gRPC RPCs on any gRPC server with reflection enabled.
You may and should use TAB completion for all arguments (currently only
supported in BASH and FISH).
SYNOPSIS:
Unary and server-streaming RPCs:
gwhisper [OPTION ]... <hostname>[:port] <service> <method> [<fieldName>=FIELD_VALUE ]...
Client-streaming RPCs:
gwhisper [OPTION ]... <hostname>[:port] <service> <method> [:[<fieldName>=FIELD_VALUE ]...: ]...
The default TCP port used to connect to a gRPC server is 50051.
If some or all fields of the request message are omitted, they are initialized
to their default value according to the proto3 language reference. See
https://developers.google.com/protocol-buffers/docs/proto3#default
for details.
OPTION:
General options:
-h
--help
Shows this help and exits.
--version
Prints version information and exits.
Behavioral options:
--complete[=DIALECT]
Shows possible next arguments and exits.
DIALECT selects how suggections are formatted. Usually dialects customize
the printed suggestions to be compatible with the completion API of a
given shell.
Currently two dialects are supported:
fish: compatible putput for the fish 'complete' command
bash: compatible output for the bash 'complete' command
If no DIALECT is specified 'bash' is used as a default.
--connectTimeoutMilliseconds=TIMEOUT_VALUE
Default: 500
Sets the timeout for the gRPC Channel to go into connected state. If the
channel is not in connected state after the specified timeout, the gRPC
call and reflection-based completion attempts are aborted.
Output formatting options:
--noColor
Disables colors in the output of gRPC replies.
NOTE: colors are automatically disabled when gwhisper is outputting
into a pipe.
--color
Enables colors also in pipes.
--noSimpleMapOutput
Disable the map outputted as "key => value" of gRPC replies.
--customOutput OUTPUT_FORMAT
Instead of printing the reply message using the default human readable
format, a custom format as specified in OUTPUT_FORMAT is used.
See OUTPUT_FORMAT section for a description of the OUTPUT_FORMAT
language.
NOTE: This is an experimental feature and will be documented in detail,
once finished.
Debug options:
--dot
Prints a graphviz digraph, representing the current grammar of the
parser.
--printParsedMessage
Prints the parsed request message in a human readable format before
calling the remote procedure.
--debugComplete
Prints debug information about completion (might only be useful if
--complete is also present).
FIELD_VALUE:
Field values in the request message may be specified as follows:
- integers:
decimal (e.g. 46, -46, +46)
hexadecimal (e.g. 0x45ab, -0x45Ab, +0x45ab)
NOTE: When parsing hex numbers the case is ignored.
octal (e.g. 078, -078, +078)
- floats:
decimal (e.g. 31, -67.421e-8, 83.456, 23.3e8)
hexadecimal (e.g. -0xa7B6p-7)
NOTE: When parsing hex numbers the case is ignored.
- bytes:
As a hex number or as input from a file:
- The hex number is prefixed with '0x' (e.g. 0xab4B2F2e9d7f)
NOTE: Only multiple of 8 bits possible
NOTE: When parsing hex numbers the case is ignored.
- The input filename is prefixed with 'file://' (e.g. file://myfile.bin)
- strings:
As a string without quotes. (e.g. ThisIsAString)
NOTE: gWhisper control characters ' ', ',' or ':' need to be escaped by
pre-pending a ':'
- enum values:
As the enum value name
Enum values are tab-completed
- bools
true, false, 1, 0
Bool values are tab-completed
- nested types:
The nested type fields enclosed in colons. E.g. target=:field1=1 field2=2:
Nested types are tab-completed
- repeated fields:
A list of field values enclosed in colons, separated with a comma and a
whitespace.
E.g. values=:2, 4, 16, 32:
Repeated fields are tab-completed
- map fields:
As a repeated field with nested key, value pairs (protobuf representation
of maps).
E.g. my_map=::key=5 value=testval:, :key=40 value=anotherValue::
Map fields are tab-completed
OUTPUT_FORMAT:
This is a program written in a very simple formatting language.
A valid program has the following form:
@ (.<FieldName>)+ : ( <String> || /<FieldName>[%<Modifier>]/ )+ :
The modifier is optional. Valid modifiers are: 'default', 'dec', 'hex' and
'raw' (binary output)
Example:
./gwhisper --customOutput @.listOfDevices:Found device /device_name%default/$'\n': 127.0.0.1 discoveryService.devices GetDevices
Output:
Found device Mouse
Found device Keyboard
Found device Screen
...
This will search for any number of fields with a name "listOfDevices" in the
RPC reply message. For each match (multiple in case of repeated field), The
string `"Found device /device_name/\n"` is printed with `/device_name/`
replaced by the value of the field `"device_name"`.
EXAMPLES:
gwhisper exampledomain.org:50059 bakery orderCookies amount=5
Connects to the gRPC server running at exampledomain.org on TCP port 50059
and calls the orderCookies RPC method of the bakery service.
A request message will be passed to the RPC call with the 'amount' field
set to 5. Other fields, which might be present in the message type, but
not specified here, are initialized to default values.
gwhisper [2001:db8::2:1]:50059 bakery orderCookies config=:chocolate=true smarties=false: amount=5
Uses IPv6 address and nested types in the request message.
gwhisper 192.168.0.43 bakery orderCookies amount=0xa
Uses IPv4 address, default TCP port of 50051 and field value as hex.
gwhisper 127.0.0.1 examples.StreamingRpcs requestStreamCountMessages :: ::
Issues a client-streaming RPC against the example server, streaming two empty messages.
gwhisper 127.0.0.1 examples.StreamingRpcs bidirectionalStreamNegateNumbers :number=3: :number=7:
Issues a bi-directional streaming RPC against the example server.
Result will be:
number = -3
number = -7