clean up --help output for barriers/barrierc at kloetzl's request. ref commit 63a7936

This commit is contained in:
walker0643 2018-03-17 16:55:53 -04:00
parent 63a7936e9f
commit d75bdb8ec0
2 changed files with 44 additions and 64 deletions

View File

@ -59,6 +59,7 @@
#include <iostream> #include <iostream>
#include <stdio.h> #include <stdio.h>
#include <sstream>
#define RETRY_TIME 1.0 #define RETRY_TIME 1.0
@ -119,35 +120,25 @@ ClientApp::help()
# define WINAPI_INFO # define WINAPI_INFO
#endif #endif
char buffer[2000]; std::ostringstream buffer;
sprintf( buffer << "Start the barrier client and connect to a remote server component." << std::endl
buffer, << std::endl
"Start the barrier client and connect to a remote server component.\n" << "Usage: " << args().m_pname << " [--yscroll <delta>]" << WINAPI_ARG << HELP_SYS_ARGS
"\n" << HELP_COMMON_ARGS << " <server-address>" << std::endl
"Usage: %s" << std::endl
" [--yscroll <delta>]" << "Options:" << std::endl
WINAPI_ARG << HELP_COMMON_INFO_1 << WINAPI_INFO << HELP_SYS_INFO
HELP_SYS_ARGS << " --yscroll <delta> defines the vertical scrolling delta, which is" << std::endl
HELP_COMMON_ARGS << " 120 by default." << std::endl
" <server-address>" << HELP_COMMON_INFO_2
"\n\n" << std::endl
"Options:\n" << "Default options are marked with a *" << std::endl
HELP_COMMON_INFO_1 << std::endl
WINAPI_INFO << "The server address is of the form: [<hostname>][:<port>]. The hostname" << std::endl
HELP_SYS_INFO << "must be the address or hostname of the server. The port overrides the" << std::endl
" --yscroll <delta> defines the vertical scrolling delta, which is\n" << "default port, " << kDefaultPort << "." << std::endl;
" 120 by default.\n"
HELP_COMMON_INFO_2
"\n"
"Default options are marked with a *\n"
"\n"
"The server address is of the form: [<hostname>][:<port>]. The hostname\n"
"must be the address or hostname of the server. The port overrides the\n"
"default port, %d.\n",
args().m_pname, kDefaultPort
);
LOG((CLOG_PRINT "%s", buffer)); LOG((CLOG_PRINT "%s", buffer.str().c_str()));
} }
const char* const char*

View File

@ -59,6 +59,7 @@
#include <iostream> #include <iostream>
#include <stdio.h> #include <stdio.h>
#include <fstream> #include <fstream>
#include <sstream>
// //
// ServerApp // ServerApp
@ -120,43 +121,31 @@ ServerApp::help()
# define WINAPI_INFO # define WINAPI_INFO
#endif #endif
char buffer[3000]; std::ostringstream buffer;
sprintf( buffer << "Start the barrier server component." << std::endl
buffer, << std::endl
"Start the barrier server component.\n" << "Usage: " << args().m_pname
"\n" << " [--address <address>]"
"Usage: %s" << " [--config <pathname>]"
" [--address <address>]" << WINAPI_ARGS << HELP_SYS_ARGS << HELP_COMMON_ARGS << std::endl
" [--config <pathname>]" << std::endl
WINAPI_ARGS << "Options:" << std::endl
HELP_SYS_ARGS << " -a, --address <address> listen for clients on the given address." << std::endl
HELP_COMMON_ARGS << " -c, --config <pathname> use the named configuration file instead." << std::endl
"\n\n" << HELP_COMMON_INFO_1 << WINAPI_INFO << HELP_SYS_INFO << HELP_COMMON_INFO_2 << std::endl
"Options:\n" << "Default options are marked with a *" << std::endl
" -a, --address <address> listen for clients on the given address.\n" << std::endl
" -c, --config <pathname> use the named configuration file instead.\n" << "The argument for --address is of the form: [<hostname>][:<port>]. The" << std::endl
HELP_COMMON_INFO_1 << "hostname must be the address or hostname of an interface on the system." << std::endl
WINAPI_INFO << "The default is to listen on all interfaces. The port overrides the" << std::endl
HELP_SYS_INFO << "default port, " << kDefaultPort << "." << std::endl
HELP_COMMON_INFO_2 << std::endl
"\n" << "If no configuration file pathname is provided then the first of the" << std::endl
"Default options are marked with a *\n" << "following to load successfully sets the configuration:" << std::endl
"\n" << " $HOME/" << USR_CONFIG_NAME << std::endl
"The argument for --address is of the form: [<hostname>][:<port>]. The\n" << " " << ARCH->concatPath(ARCH->getSystemDirectory(), SYS_CONFIG_NAME) << std::endl;
"hostname must be the address or hostname of an interface on the system.\n"
"The default is to listen on all interfaces. The port overrides the\n"
"default port, %d.\n"
"\n"
"If no configuration file pathname is provided then the first of the\n"
"following to load successfully sets the configuration:\n"
" $HOME/%s\n"
" %s\n",
args().m_pname, kDefaultPort,
USR_CONFIG_NAME,
ARCH->concatPath(ARCH->getSystemDirectory(), SYS_CONFIG_NAME).c_str()
);
LOG((CLOG_PRINT "%s", buffer)); LOG((CLOG_PRINT "%s", buffer.str().c_str()));
} }
void void