[Nbd] [PATCH 1/2] nbd-server: Improve command line documentation
- To: nbd-general@lists.sourceforge.net
- Subject: [Nbd] [PATCH 1/2] nbd-server: Improve command line documentation
- From: Eric Blake <eblake@...696...>
- Date: Thu, 15 Dec 2016 20:09:20 -0600
- Message-id: <20161216020921.31290-2-eblake@...696...>
- In-reply-to: <20161216020921.31290-1-eblake@...696...>
- References: <20161216020921.31290-1-eblake@...696...>
Mention -d in --help output, to match that it is listed in the
man page. Update the man page examples and the --help output
to make it obvious that our preferred usage nowadays will omit
the port/file/size arguments, since the config file is more
powerful.
Signed-off-by: Eric Blake <eblake@...696...>
---
man/nbd-server.1.in.sgml | 8 +++++++-
nbd-server.c | 9 ++++++---
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/man/nbd-server.1.in.sgml b/man/nbd-server.1.in.sgml
index 72a840b..d1d4301 100644
--- a/man/nbd-server.1.in.sgml
+++ b/man/nbd-server.1.in.sgml
@@ -269,7 +269,13 @@ manpage.1: manpage.sgml
<para>Some examples of nbd-server usage:</para>
<itemizedlist mark="none">
<listitem>
- <para>To export a file /export/nbd/exp-bl-dev on port 2000:</para>
+ <para>The simplest usage, when everything is specified in the
+ configuration file (preferred):</para>
+ <para><command>nbd-server -C /path/to/config</command></para>
+ </listitem>
+ <listitem>
+ <para>To export a file /export/nbd/exp-bl-dev on port 2000,
+ using the older command line syntax:</para>
<para><command>nbd-server 2000 /export/nbd/exp-bl-dev</command></para>
</listitem>
<listitem>
diff --git a/nbd-server.c b/nbd-server.c
index 76b515d..698e86e 100644
--- a/nbd-server.c
+++ b/nbd-server.c
@@ -439,11 +439,12 @@ static inline void spliceit(int fd_in, loff_t *off_in, int fd_out,
*/
void usage() {
printf("This is nbd-server version " VERSION "\n");
- printf("Usage: [ip:|ip6@]port file_to_export [size][kKmM] [-l authorize_file] [-r] [-m] [-c] [-C configuration file] [-p PID file name] [-o section name] [-M max connections] [-V]\n"
+ printf("Usage: [[ip:|ip6@]port file_to_export [size][kKmM]] [-l authorize_file] [-r] [-m] [-c] [-C configuration file] [-p PID file name] [-o section name] [-M max connections] [-d] [-V]\n"
"\t-r|--read-only\t\tread only\n"
"\t-m|--multi-file\t\tmultiple file\n"
"\t-c|--copy-on-write\tcopy on write\n"
"\t-C|--config-file\tspecify an alternate configuration file\n"
+ "\t-d|--dont-fork\t\trun in foreground rather than daemon, for debugging\n"
"\t-l|--authorize-file\tfile with list of hosts that are allowed to\n\t\t\t\tconnect.\n"
"\t-p|--pid-file\t\tspecify a filename to write our PID to\n"
"\t-o|--output-config\toutput a config file section for what you\n\t\t\t\tspecified on the command line, with the\n\t\t\t\tspecified section name\n"
@@ -451,8 +452,10 @@ void usage() {
"\t-V|--version\toutput the version and exit\n\n"
"\tif port is set to 0, stdin is used (for running from inetd).\n"
"\tif file_to_export contains '%%s', it is substituted with the IP\n"
- "\t\taddress of the machine trying to connect\n"
- "\tif ip is set, it contains the local IP address on which we're listening.\n\tif not, the server will listen on all local IP addresses\n");
+ "\t\taddress of the machine trying to connect\n"
+ "\tif ip is set, it contains the local IP address on which we're listening.\n\tif not, the server will listen on all local IP addresses.\n"
+ "\n\tNote that port, file_to_export, and size are deprecated in favor of the\n\tconfiguration file specified by -C.\n"
+ );
printf("Using configuration file %s\n", CFILE);
}
--
2.9.3
Reply to: