mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
harmonize usage info
This commit is contained in:
parent
fdcd4ff0ca
commit
51f7179f0e
7 changed files with 59 additions and 50 deletions
|
@ -36,17 +36,20 @@
|
|||
#include <villas/shmem.h>
|
||||
#include <villas/utils.h>
|
||||
#include <villas/utils.hpp>
|
||||
#include <villas/copyright.hpp>
|
||||
|
||||
using namespace villas;
|
||||
|
||||
static std::atomic<bool> stop(false);
|
||||
|
||||
void usage()
|
||||
static void usage()
|
||||
{
|
||||
std::cout << "Usage: villas-test-shmem WNAME VECTORIZE" << std::endl
|
||||
<< " WNAME name of the shared memory object for the output queue" << std::endl
|
||||
<< " RNAME name of the shared memory object for the input queue" << std::endl
|
||||
<< " VECTORIZE maximum number of samples to read/write at a time" << std::endl;
|
||||
|
||||
print_copyright();
|
||||
}
|
||||
|
||||
void quit(int, siginfo_t*, void*)
|
||||
|
|
|
@ -111,8 +111,6 @@ static void usage()
|
|||
std::cout << std::endl;
|
||||
|
||||
print_copyright();
|
||||
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
@ -124,8 +122,10 @@ int main(int argc, char *argv[])
|
|||
try {
|
||||
/* Check arguments */
|
||||
#ifdef ENABLE_OPAL_ASYNC
|
||||
if (argc != 4)
|
||||
usage(argv[0]);
|
||||
if (argc != 4) {
|
||||
usage();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
opal_register_region(argc, argv);
|
||||
|
||||
|
|
|
@ -388,17 +388,16 @@ int protocol_cb(lws *wsi, enum lws_callback_reasons reason, void *user, void *in
|
|||
return 0;
|
||||
}
|
||||
|
||||
void usage()
|
||||
static void usage()
|
||||
{
|
||||
std::cout << "Usage: villas-relay [OPTIONS]" << std::endl;
|
||||
std::cout << " OPTIONS is one or more of the following options:" << std::endl;
|
||||
std::cout << " -d LVL set debug level" << std::endl;
|
||||
std::cout << " -p PORT the port number to listen on" << std::endl;
|
||||
std::cout << " -P PROT the websocket protocol" << std::endl;
|
||||
std::cout << " -l enable loopback of own data" << std::endl;
|
||||
std::cout << " -V show version and exit" << std::endl;
|
||||
std::cout << " -h show usage and exit" << std::endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << "Usage: villas-relay [OPTIONS]" << std::endl
|
||||
<< " OPTIONS is one or more of the following options:" << std::endl
|
||||
<< " -d LVL set debug level" << std::endl
|
||||
<< " -p PORT the port number to listen on" << std::endl
|
||||
<< " -P PROT the websocket protocol" << std::endl
|
||||
<< " -l enable loopback of own data" << std::endl
|
||||
<< " -V show version and exit" << std::endl
|
||||
<< " -h show usage and exit" << std::endl << std::endl;
|
||||
|
||||
villas::print_copyright();
|
||||
}
|
||||
|
|
|
@ -46,6 +46,33 @@ using namespace villas;
|
|||
|
||||
static std::atomic<bool> stop(false);
|
||||
|
||||
static void usage()
|
||||
{
|
||||
std::cout << "Usage: villas-signal [OPTIONS] SIGNAL" << std::endl
|
||||
<< " SIGNAL is on of the following signal types:" << std::endl
|
||||
<< " mixed" << std::endl
|
||||
<< " random" << std::endl
|
||||
<< " sine" << std::endl
|
||||
<< " triangle" << std::endl
|
||||
<< " square" << std::endl
|
||||
<< " ramp" << std::endl
|
||||
<< " constants" << std::endl
|
||||
<< " counter" << std::endl << std::endl
|
||||
<< " OPTIONS is one or more of the following options:" << std::endl
|
||||
<< " -d LVL set debug level" << std::endl
|
||||
<< " -f FMT set the format" << std::endl
|
||||
<< " -v NUM specifies how many values a message should contain" << std::endl
|
||||
<< " -r HZ how many messages per second" << std::endl
|
||||
<< " -n non real-time mode. do not throttle output." << std::endl
|
||||
<< " -F HZ the frequency of the signal" << std::endl
|
||||
<< " -a FLT the amplitude" << std::endl
|
||||
<< " -D FLT the standard deviation for 'random' signals" << std::endl
|
||||
<< " -o OFF the DC bias" << std::endl
|
||||
<< " -l NUM only send LIMIT messages and stop" << std::endl << std::endl;
|
||||
|
||||
print_copyright();
|
||||
}
|
||||
|
||||
json_t * parse_cli(int argc, char *argv[])
|
||||
{
|
||||
Logger logger = logging.get("signal");
|
||||
|
@ -64,7 +91,7 @@ json_t * parse_cli(int argc, char *argv[])
|
|||
/* Parse optional command line arguments */
|
||||
int c;
|
||||
char *endptr;
|
||||
while ((c = getopt(argc, argv, "v:r:f:l:a:D:no:d:")) != -1) {
|
||||
while ((c = getopt(argc, argv, "v:r:f:l:a:D:no:d:hV")) != -1) {
|
||||
switch (c) {
|
||||
case 'n':
|
||||
rt = 0;
|
||||
|
@ -102,8 +129,14 @@ json_t * parse_cli(int argc, char *argv[])
|
|||
logging.setLevel(optarg);
|
||||
break;
|
||||
|
||||
case 'V':
|
||||
print_version();
|
||||
exit(EXIT_SUCCESS);
|
||||
|
||||
case 'h':
|
||||
case '?':
|
||||
break;
|
||||
usage();
|
||||
exit(c == '?' ? EXIT_FAILURE : EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
continue;
|
||||
|
@ -131,33 +164,6 @@ check: if (optarg == endptr)
|
|||
);
|
||||
}
|
||||
|
||||
void usage()
|
||||
{
|
||||
std::cout << "Usage: villas-signal [OPTIONS] SIGNAL" << std::endl
|
||||
<< " SIGNAL is on of the following signal types:" << std::endl
|
||||
<< " mixed" << std::endl
|
||||
<< " random" << std::endl
|
||||
<< " sine" << std::endl
|
||||
<< " triangle" << std::endl
|
||||
<< " square" << std::endl
|
||||
<< " ramp" << std::endl
|
||||
<< " constants" << std::endl
|
||||
<< " counter" << std::endl << std::endl
|
||||
<< " OPTIONS is one or more of the following options:" << std::endl
|
||||
<< " -d LVL set debug level" << std::endl
|
||||
<< " -f FMT set the format" << std::endl
|
||||
<< " -v NUM specifies how many values a message should contain" << std::endl
|
||||
<< " -r HZ how many messages per second" << std::endl
|
||||
<< " -n non real-time mode. do not throttle output." << std::endl
|
||||
<< " -F HZ the frequency of the signal" << std::endl
|
||||
<< " -a FLT the amplitude" << std::endl
|
||||
<< " -D FLT the standard deviation for 'random' signals" << std::endl
|
||||
<< " -o OFF the DC bias" << std::endl
|
||||
<< " -l NUM only send LIMIT messages and stop" << std::endl << std::endl;
|
||||
|
||||
print_copyright();
|
||||
}
|
||||
|
||||
static void quit(int signal, siginfo_t *sinfo, void *ctx)
|
||||
{
|
||||
Logger logger = logging.get("signal");
|
||||
|
|
|
@ -90,7 +90,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
void usage()
|
||||
static void usage()
|
||||
{
|
||||
std::cout << "Usage: villas-test-cmp [OPTIONS] FILE1 FILE2 ... FILEn" << std::endl
|
||||
<< " FILE a list of files to compare" << std::endl
|
||||
|
|
|
@ -54,7 +54,7 @@ void quit(int signal, siginfo_t *sinfo, void *ctx)
|
|||
stop = true;
|
||||
}
|
||||
|
||||
void usage()
|
||||
static void usage()
|
||||
{
|
||||
std::cout << "Usage: villas-test-rtt [OPTIONS] CONFIG NODE" << std::endl
|
||||
<< " CONFIG path to a configuration file" << std::endl
|
||||
|
@ -101,7 +101,7 @@ int main(int argc, char *argv[])
|
|||
/* Parse Arguments */
|
||||
int c;
|
||||
char *endptr;
|
||||
while ((c = getopt (argc, argv, "w:h:r:f:c:b:Vd:")) != -1) {
|
||||
while ((c = getopt (argc, argv, "w:hr:f:c:b:Vd:")) != -1) {
|
||||
switch (c) {
|
||||
case 'c':
|
||||
count = strtoul(optarg, &endptr, 10);
|
||||
|
|
|
@ -40,12 +40,13 @@ ARGS=${@:2}
|
|||
|
||||
# Check if tool is available
|
||||
if ! [[ "$TOOL" =~ $(echo ^\($TOOLS\)$) ]]; then
|
||||
echo "Usage: villas [TOOL]" 1>&2
|
||||
echo "Usage: villas [TOOL]"
|
||||
echo " TOOL is one of ${TOOLS}"
|
||||
echo
|
||||
echo "For detailed documentation, please run 'villas node'"
|
||||
echo " and point your web browser to http://localhost:80"
|
||||
echo "For detailed documentation, please see: 'villas node'"
|
||||
echo " http://villas.fein-aachen.org/doc/"
|
||||
echo
|
||||
|
||||
# Show VILLASnode copyright and contact info
|
||||
villas-node -h | tail -n3
|
||||
exit 1
|
||||
|
|
Loading…
Add table
Reference in a new issue