Skip to content

Commit e83c6ac

Browse files
committed
docs: Adjust synopsis and options for consistency
Consistent sort ordering. (Fairly) consistent use of "=" between long options and argument. Separate out --version from the list in the synopsis because it is a modal option. Clearer documentation for --run. Add documentation for --mask-handshake which wasn't covered in the main documentation (it was documented in nbdkit-protocol(1)). (cherry picked from commit 0187162)
1 parent 9ef9060 commit e83c6ac

File tree

4 files changed

+60
-52
lines changed

4 files changed

+60
-52
lines changed

docs/nbdkit-captive.pod

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ reliably cleaned up
55

66
=head1 SYNOPSIS
77

8-
nbdkit PLUGIN [...] [-e|--exportname EXPORTNAME] --run "CMD ARGS ..."
8+
nbdkit PLUGIN [...] [-e|--exportname EXPORTNAME] \
9+
--run 'COMMAND ARGS ...'
910

1011
nbdkit --exit-with-parent PLUGIN [...]
1112

docs/nbdkit.pod

+43-37
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,11 @@ This option implies I<--foreground>.
233233

234234
=item B<-e> EXPORTNAME
235235

236-
=item B<--export> EXPORTNAME
236+
=item B<--export=>EXPORTNAME
237237

238-
=item B<--export-name> EXPORTNAME
238+
=item B<--export-name=>EXPORTNAME
239239

240-
=item B<--exportname> EXPORTNAME
240+
=item B<--exportname=>EXPORTNAME
241241

242242
Set a preferred exportname to expose in the shell environment created
243243
during I<--run>. The use of this option without I<--run> has no
@@ -249,6 +249,13 @@ the client's choice of export name.
249249
If not set, the I<--run> environment is set to access the default
250250
exportname C<""> (empty string).
251251

252+
=item B<--filter=>FILTER
253+
254+
Add a filter before the plugin. This option may be given one or more
255+
times to stack filters in front of the plugin. They are processed in
256+
the order they appear on the command line. See L</FILTERS> and
257+
L<nbdkit-filter(3)>.
258+
252259
=item B<-f>
253260

254261
=item B<--foreground>
@@ -257,16 +264,9 @@ exportname C<""> (empty string).
257264

258265
I<Don't> fork into the background.
259266

260-
=item B<--filter> FILTER
261-
262-
Add a filter before the plugin. This option may be given one or more
263-
times to stack filters in front of the plugin. They are processed in
264-
the order they appear on the command line. See L</FILTERS> and
265-
L<nbdkit-filter(3)>.
266-
267267
=item B<-g> GROUP
268268

269-
=item B<--group> GROUP
269+
=item B<--group=>GROUP
270270

271271
Change group to C<GROUP> after starting up. A group name or numeric
272272
group ID can be used.
@@ -278,9 +278,9 @@ See also I<-u>.
278278

279279
=item B<-i> IPADDR
280280

281-
=item B<--ip-addr> IPADDR
281+
=item B<--ip-addr=>IPADDR
282282

283-
=item B<--ipaddr> IPADDR
283+
=item B<--ipaddr=>IPADDR
284284

285285
Listen on the specified interface. The default is to listen on all
286286
interfaces. See also I<-4>, I<-6>, and I<-p>.
@@ -300,6 +300,12 @@ forks into the background in which case they are sent to syslog.
300300

301301
For more details see L<nbdkit-service(1)/LOGGING>.
302302

303+
=item B<--mask-handshake=>MASK
304+
305+
This option can be used to mask off particular global features which
306+
are advertised during new-style handshake (defaulting to all supported
307+
bits set). See L<nbdkit-protocol(1)>.
308+
303309
=item B<-n>
304310

305311
=item B<--new-style>
@@ -331,9 +337,9 @@ See L<nbdkit-protocol(1)>.
331337

332338
=item B<-P> PIDFILE
333339

334-
=item B<--pid-file> PIDFILE
340+
=item B<--pid-file=>PIDFILE
335341

336-
=item B<--pidfile> PIDFILE
342+
=item B<--pidfile=>PIDFILE
337343

338344
Write C<PIDFILE> (containing the process ID of the server) after
339345
nbdkit becomes ready to accept connections.
@@ -343,7 +349,7 @@ delete the file when it exits.
343349

344350
=item B<-p> PORT
345351

346-
=item B<--port> PORT
352+
=item B<--port=>PORT
347353

348354
Change the TCP/IP port number on which nbdkit serves requests.
349355
The default is C<10809>. See also I<-i>.
@@ -364,16 +370,29 @@ L<nbdkit-cow-filter(1)> can be placed over read-only plugins to
364370
provide copy-on-write (or "snapshot") functionality. If you are using
365371
qemu as a client then it also supports snapshots.
366372

367-
=item B<--run> CMD
373+
=item B<--run> 'COMMAND ARGS ...'
368374

369-
Run nbdkit as a captive subprocess of C<CMD>. When C<CMD> exits,
370-
nbdkit is killed. See L<nbdkit-captive(1)/CAPTIVE NBDKIT>.
375+
Run nbdkit as a captive subprocess of the command. When the command
376+
exits, nbdkit is killed. See L<nbdkit-captive(1)/CAPTIVE NBDKIT>.
371377

372378
Note that the command is executed by F</bin/sh>. On some platforms
373379
like Debian this might not be a full-featured shell.
374380

375381
This option implies I<--foreground>.
376382

383+
=item B<--selinux-label=>SOCKET-LABEL
384+
385+
Apply the SELinux label C<SOCKET-LABEL> to the nbdkit listening
386+
socket.
387+
388+
The common — perhaps only — use of this option is to allow libvirt
389+
guests which are using SELinux and sVirt confinement to access nbdkit
390+
Unix domain sockets. The example below shows how to do this. Note
391+
that the socket and filesystem labels are different.
392+
393+
nbdkit -U /tmp/sock --selinux-label=system_u:object_r:svirt_socket_t:s0 ...
394+
chcon system_u:object_r:svirt_image_t:s0 /tmp/sock
395+
377396
=item B<-s>
378397

379398
=item B<--single>
@@ -391,19 +410,6 @@ L<nbdkit-service(1)/SOCKET ACTIVATION> instead of this option.
391410

392411
This option implies I<--foreground>.
393412

394-
=item B<--selinux-label> SOCKET-LABEL
395-
396-
Apply the SELinux label C<SOCKET-LABEL> to the nbdkit listening
397-
socket.
398-
399-
The common — perhaps only — use of this option is to allow libvirt
400-
guests which are using SELinux and sVirt confinement to access nbdkit
401-
Unix domain sockets. The example below shows how to do this. Note
402-
that the socket and filesystem labels are different.
403-
404-
nbdkit -U /tmp/sock --selinux-label=system_u:object_r:svirt_socket_t:s0 ...
405-
chcon system_u:object_r:svirt_image_t:s0 /tmp/sock
406-
407413
=item B<--swap>
408414

409415
(nbdkit E<ge> 1.18)
@@ -417,7 +423,7 @@ the process.
417423

418424
=item B<-t> THREADS
419425

420-
=item B<--threads> THREADS
426+
=item B<--threads=>THREADS
421427

422428
Set the number of threads to be used per connection, which in turn
423429
controls the number of outstanding requests that can be processed at
@@ -434,13 +440,13 @@ is not prepared for out-of-order responses), set this to 1.
434440
Disable, enable or require TLS (authentication and encryption
435441
support). See L<nbdkit-tls(1)>.
436442

437-
=item B<--tls-certificates> /path/to/certificates
443+
=item B<--tls-certificates=>/path/to/certificates
438444

439445
Set the path to the TLS certificates directory. If not specified,
440446
some built-in paths are checked. See L<nbdkit-tls(1)> for more
441447
details.
442448

443-
=item B<--tls-psk> /path/to/pskfile
449+
=item B<--tls-psk=>/path/to/pskfile
444450

445451
Set the path to the pre-shared keys (PSK) file. If used, this
446452
overrides certificate authentication. There is no built-in path. See
@@ -453,7 +459,7 @@ check the client's certificate.
453459

454460
=item B<-U> SOCKET
455461

456-
=item B<--unix> SOCKET
462+
=item B<--unix=>SOCKET
457463

458464
=item B<-U ->
459465

@@ -477,7 +483,7 @@ private socket. This is useful with L<nbdkit-captive(1)/CAPTIVE NBDKIT>.
477483

478484
=item B<-u> USER
479485

480-
=item B<--user> USER
486+
=item B<--user=>USER
481487

482488
Change user to C<USER> after starting up. A user name or numeric user
483489
ID can be used.

docs/synopsis.txt

+14-13
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
nbdkit [-4|--ipv4-only] [-6|--ipv6-only]
22
[-D|--debug PLUGIN|FILTER|nbdkit.FLAG=N]
3-
[-e|--exportname EXPORTNAME] [--exit-with-parent]
4-
[--filter FILTER ...] [-f|--foreground]
3+
[--exit-with-parent] [-e|--exportname EXPORTNAME]
4+
[--filter=FILTER ...] [-f|--foreground]
55
[-g|--group GROUP] [-i|--ipaddr IPADDR]
6-
[--log stderr|syslog|null]
7-
[-n|--newstyle] [--mask-handshake MASK] [--no-sr] [-o|--oldstyle]
8-
[-P|--pidfile PIDFILE]
9-
[-p|--port PORT] [-r|--readonly]
10-
[--run CMD] [-s|--single] [--selinux-label LABEL] [--swap]
11-
[-t|--threads THREADS]
12-
[--tls off|on|require]
13-
[--tls-certificates /path/to/certificates]
14-
[--tls-psk /path/to/pskfile] [--tls-verify-peer]
15-
[-U|--unix SOCKET] [-u|--user USER]
16-
[-v|--verbose] [-V|--version] [--vsock]
6+
[--log=stderr|syslog|null] [--mask-handshake=MASK]
7+
[-n|--newstyle] [--no-sr] [-o|--oldstyle]
8+
[-P|--pidfile PIDFILE] [-p|--port PORT]
9+
[-r|--readonly] [--run 'COMMAND ARGS ...']
10+
[--selinux-label=LABEL] [-s|--single] [--swap]
11+
[-t|--threads THREADS] [--tls=off|on|require]
12+
[--tls-certificates=/path/to/certificates]
13+
[--tls-psk=/path/to/pskfile] [--tls-verify-peer]
14+
[-U|--unix SOCKET|-] [-u|--user USER]
15+
[-v|--verbose] [--vsock]
1716
PLUGIN [[KEY=]VALUE [KEY=VALUE [...]]]
1817

1918
nbdkit --dump-config
2019

2120
nbdkit PLUGIN --dump-plugin
2221

2322
nbdkit --help
23+
24+
nbdkit [-V|--version]

server/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ CLEANFILES += synopsis.c
146146
main.c: synopsis.c
147147
synopsis.c: $(top_srcdir)/docs/synopsis.txt
148148
rm -f $@ $@-t
149-
$(SED) -e 's/\(.*\)/"\1\\n"/g' $< > $@-t
149+
$(SED) -e 's/"/\\"/g' -e 's/\(.*\)/"\1\\n"/g' $< > $@-t
150150
mv $@-t $@
151151

152152
# pkg-config / pkgconf

0 commit comments

Comments
 (0)