This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Tarantool -- an efficient key/value data store".
The branch core-help has been updated
via 5fa44c6e6f646ba3fa8e6a377608186110dd64bd (commit)
via ae9e5ef64f1cc8e0495b02cbf0f46cd86996992d (commit)
via 1419a6e2943fd59099c2e60621dae507a51eda91 (commit)
via 2e426125285047cd43029903da95ddbe75703d33 (commit)
via 66e5ed9489a7a976e998007438f4503d443b87f6 (commit)
via df298cada5a2adb4892b2e8db01f06dbcf636a18 (commit)
via 9db2803c48c2f2e089c556e861ad12dac8d74f88 (commit)
via 87bd27a3758d5f5245ebb2c2002862a94e44b02a (commit)
via 53cb9701ec11a5bdd74959f2b79742f50e91fd74 (commit)
via d8df4aee5b13c7c40808b8783425f17ff0c9a81b (commit)
from ba71da768ad562e3a0c4146521942f8e7b075325 (commit)
Summary of changes:
.gitignore | 6 +-
core/tarantool.c | 40 +++--
doc/silverbox-protocol.txt | 93 ++++++----
test/admin.py | 53 +-----
test/box/args.result | 31 ++++
test/box/args.test | 12 ++
test/box/show.result | Bin 0 -> 2180 bytes
test/box/show.test | 77 ++------
test/box/suite.ini | 2 -
test/cmd/args.test | 8 -
test/cmd/suite.ini | 5 -
test/cmd/tarantool.cfg | 16 --
test/cmdline.py | 84 ---------
test/lib/admin.py | 90 ++++++++++
test/lib/tarantool_preprocessor.py | 63 +++++++
test/lib/tarantool_silverbox_server.py | 134 ++++++++++++++
test/lib/test_suite.py | 249 ++++++++++++++++++++++++++
test/test-run.py | 304 +-------------------------------
third_party/gopt/gopt.c | 10 +-
19 files changed, 705 insertions(+), 572 deletions(-)
create mode 100644 test/box/args.result
create mode 100644 test/box/args.test
create mode 100644 test/box/show.result
delete mode 100644 test/cmd/args.test
delete mode 100644 test/cmd/suite.ini
delete mode 100644 test/cmd/tarantool.cfg
delete mode 100755 test/cmdline.py
create mode 100644 test/lib/__init__.py
create mode 100644 test/lib/admin.py
create mode 100644 test/lib/tarantool_preprocessor.py
create mode 100644 test/lib/tarantool_silverbox_server.py
create mode 100644 test/lib/test_suite.py
commit 5fa44c6e6f646ba3fa8e6a377608186110dd64bd
Author: Konstantin Osipov <[email protected]>
Date: Mon Dec 20 20:37:06 2010 +0300
Bug#684700 -h and --help options are broken
Merge with the master (new version of the test-runner).
Fix failing tests.
diff --git a/core/tarantool.c b/core/tarantool.c
index acfd97b..05d23e4 100644
--- a/core/tarantool.c
+++ b/core/tarantool.c
@@ -263,7 +263,7 @@ main(int argc, char **argv)
void *opt = gopt_sort(&argc, (const char **)argv, opt_def);
- if (gopt(opt, 'v')){
+ if (gopt(opt, 'V')){
puts(tarantool_version());
return 0;
}
diff --git a/test/box/args.result b/test/box/args.result
index 24bba24..21d9c9b 100644
--- a/test/box/args.result
+++ b/test/box/args.result
@@ -1,14 +1,24 @@
tarantool_silverbox --no-such-option
-tarantool_silverbox: unrecognized option '--no-such-option'
-<time> <pid> 0/(null) _ F> PANIC tarantool.c:deamon is running
+tarantool_silverbox: --no-such-option: unknown option
tarantool_silverbox --help
-tarantool_silverbox: unrecognized option '--help'
-<time> <pid> 0/(null) _ F> PANIC tarantool.c:deamon is running
+Tarantool -- an efficient in-memory data store.
+Usage: tarantool_silverbox [OPTIONS]
+
+ --cfg-get=KEY return a value from configuration file described
by KEY
+ -c, --config=FILE path to configuration file (default:
tarantool.cfg)
+ --cat=FILE cat snapshot file to stdout in readable format
and exit
+ --init-storage initialize storage (an empty snapshot file) and
exit
+ -v, --verbose increase verbosity level in log messages
+ -D, --daemonize redirect input/output streams to a log file and
run as daemon
+ -h, --help display this help and exit
+ -V, --version print program version and exit
+
+Please visit project home page at http:tarantool
+to see online documentation, submit bugs or contribute a patch.
tarantool_silverbox --config
-tarantool_silverbox: option '--config' requires an argument
-<time> <pid> 0/(null) _ F> PANIC tarantool.c:deamon is running
+tarantool_silverbox: --config: option requires an option argument
tarantool_silverbox --config tarantool.cfg
<time> <pid> 0/(null) _ F> PANIC tarantool.c:deamon is running
commit ae9e5ef64f1cc8e0495b02cbf0f46cd86996992d
Merge: 1419a6e 2e42612
Author: Konstantin Osipov <[email protected]>
Date: Mon Dec 20 20:33:54 2010 +0300
Merge branch 'master', remote branch 'origin' into core-help
commit 1419a6e2943fd59099c2e60621dae507a51eda91
Author: Konstantin Osipov <[email protected]>
Date: Mon Dec 20 20:32:42 2010 +0300
Bug#684700 -h and --help options are broken
Post-review fixes: realign help text to match
exactly GNU tools (21st column), reorder help
messages to provide most relvant options first,
edit help text, print values for default options.
diff --git a/core/tarantool.c b/core/tarantool.c
index c5e9250..acfd97b 100644
--- a/core/tarantool.c
+++ b/core/tarantool.c
@@ -54,7 +54,8 @@
#include <tarantool_version.h>
static pid_t master_pid;
-const char *cfg_filename = "tarantool.cfg";
+#define DEFAULT_CFG_FILENAME "tarantool.cfg"
+const char *cfg_filename = DEFAULT_CFG_FILENAME;
struct tarantool_cfg cfg;
bool init_storage;
@@ -237,35 +238,44 @@ main(int argc, char **argv)
palloc_init();
const void *opt_def =
- gopt_start(gopt_option('h', 0, gopt_shorts('h', '?'),
gopt_longs("help"),
- NULL, "display this help"),
- gopt_option('c', GOPT_ARG, gopt_shorts('c'),
gopt_longs("config"),
- "=<filename>", "path to config file"),
- gopt_option('v', 0, gopt_shorts('V'),
gopt_longs("version"),
- NULL, "print version"),
+ gopt_start(
+ gopt_option('g', GOPT_ARG, gopt_shorts(0),
+ gopt_longs("cfg-get",
"cfg_get"),
+ "=KEY", "return a value from
configuration file described by KEY"),
+ gopt_option('c', GOPT_ARG, gopt_shorts('c'),
+ gopt_longs("config"),
+ "=FILE", "path to
configuration file (default: " DEFAULT_CFG_FILENAME ")"),
#ifdef STORAGE
gopt_option('C', 0, gopt_shorts(0),
gopt_longs("cat"),
- "=<filename>", "cat file to stdout in
readable format"),
- gopt_option('I', 0, gopt_shorts(0),
gopt_longs("init_storage", "init-storage"),
- NULL, "initialize storage"),
+ "=FILE", "cat snapshot file
to stdout in readable format and exit"),
+ gopt_option('I', 0, gopt_shorts(0),
+ gopt_longs("init-storage",
"init_storage"),
+ NULL, "initialize storage
(an empty snapshot file) and exit"),
#endif
gopt_option('v', 0, gopt_shorts('v'),
gopt_longs("verbose"),
- NULL, "increase log level"),
+ NULL, "increase verbosity
level in log messages"),
gopt_option('D', 0, gopt_shorts('D'),
gopt_longs("daemonize"),
- NULL, "daemonize"),
- gopt_option('g', GOPT_ARG, gopt_shorts(0),
gopt_longs("cfg_get", "cfg-get"),
- "=<key>", "return value from config
described by key"));
+ NULL, "redirect input/output
streams to a log file and run as daemon"),
+ gopt_option('h', 0, gopt_shorts('h', '?'), gopt_longs("help"),
+ NULL, "display this help and
exit"),
+ gopt_option('V', 0, gopt_shorts('V'),
gopt_longs("version"),
+ NULL, "print program version
and exit"));
void *opt = gopt_sort(&argc, (const char **)argv, opt_def);
- if (gopt(opt, 'V')){
+ if (gopt(opt, 'v')){
puts(tarantool_version());
return 0;
}
if (gopt(opt, 'h')) {
- puts("usage:");
+ puts("Tarantool -- an efficient in-memory data store.");
+ printf("Usage: %s [OPTIONS]\n", basename(argv[0]));
+ puts("");
gopt_help(opt_def);
+ puts("");
+ puts("Please visit project home page at
http://launchpad.net/tarantool");
+ puts("to see online documentation, submit bugs or contribute a
patch.");
return 0;
}
diff --git a/third_party/gopt/gopt.c b/third_party/gopt/gopt.c
index ff16a79..5fa9960 100644
--- a/third_party/gopt/gopt.c
+++ b/third_party/gopt/gopt.c
@@ -268,10 +268,13 @@ void gopt_free( void *vptr_opts ){
void gopt_help(const void *opt_def){
const struct opt_spec_s *opt = opt_def;
+ /* -h, --help print help */
+ /* ^ this is HELP_MSG_OFFSET */
+ const int HELP_MSG_OFFSET = 21;
while (opt->key) {
const char *shorts = opt->shorts;
char has_shorts = 0;
- printf("\t");
+ printf(" ");
if (*shorts) {
has_shorts = 1;
printf("-%c", *shorts++);
@@ -285,9 +288,10 @@ void gopt_help(const void *opt_def){
else
printf(" ");
if (opt->help_arg)
- printf("--%s%-*s", *longs, 25 - strlen(*longs), opt->help_arg);
+ printf("--%s%-*s", *longs, HELP_MSG_OFFSET - strlen(*longs),
+ opt->help_arg);
else
- printf("--%-*s", 25, *longs);
+ printf("--%-*s", HELP_MSG_OFFSET, *longs);
}
if (opt->help)
puts(opt->help);
--
Tarantool -- an efficient key/value data store
_______________________________________________
Mailing list: https://launchpad.net/~tarantool-developers
Post to : [email protected]
Unsubscribe : https://launchpad.net/~tarantool-developers
More help : https://help.launchpad.net/ListHelp