Skip to content
Snippets Groups Projects
Commit 2590b285 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

Merge branch 'client-version'

parents 9e6a0ac5 4f73691a
No related branches found
No related tags found
No related merge requests found
......@@ -101,6 +101,9 @@ int main(int argc, char *argv[])
case TC_OPT_USAGE:
tc_opt_usage();
break;
case TC_OPT_VERSION:
tc_opt_version();
break;
case TC_OPT_RPL:
tc_connect();
rc = tc_wal_remote();
......
......@@ -52,7 +52,9 @@ static const void *tc_options_def = gopt_start(
gopt_option('R', GOPT_ARG, gopt_shorts('R'),
gopt_longs("rpl"), " <lsn>", "act as replica for the specified server"),
gopt_option('h', 0, gopt_shorts('h', '?'), gopt_longs("help"),
NULL, "display this help and exit")
NULL, "display this help and exit"),
gopt_option('v', 0, gopt_shorts('v'), gopt_longs("version"),
NULL, "display version information and exit")
);
void tc_opt_usage(void)
......@@ -63,6 +65,14 @@ void tc_opt_usage(void)
exit(0);
}
void tc_opt_version(void)
{
printf("tarantool client, version %s.%s\n",
TC_VERSION_MAJOR,
TC_VERSION_MINOR);
exit(0);
}
enum tc_opt_mode tc_opt_init(struct tc_opt *opt, int argc, char **argv)
{
/* usage */
......@@ -72,6 +82,12 @@ enum tc_opt_mode tc_opt_init(struct tc_opt *opt, int argc, char **argv)
goto done;
}
/* version */
if (gopt(tc_options, 'v')) {
opt->mode = TC_OPT_VERSION;
goto done;
}
/* server host */
gopt_arg(tc_options, 'a', &opt->host);
if (opt->host == NULL)
......
......@@ -26,8 +26,12 @@
* SUCH DAMAGE.
*/
#define TC_VERSION_MAJOR "0"
#define TC_VERSION_MINOR "1"
enum tc_opt_mode {
TC_OPT_USAGE,
TC_OPT_VERSION,
TC_OPT_RPL,
TC_OPT_WAL_CAT,
TC_OPT_WAL_PLAY,
......@@ -47,6 +51,7 @@ struct tc_opt {
};
void tc_opt_usage(void);
void tc_opt_version(void);
enum tc_opt_mode
tc_opt_init(struct tc_opt *opt, int argc, char **argv);
......
......@@ -12,20 +12,35 @@ tarantool - readline SQL-client for L<tarantool>.
=item -a <host>, --host <host>
Defines Server address.
Defines server address.
=item -p <port>, --port <port>
Defines server port.
=item -m <port>, --port-admin <port>
=item -m <port>, --admin-port <port>
Defines Server admin port.
Defines server admin port.
=item -C <file>, --cat <file>
Outputs xlog file content.
=item -P <file>, --play <file>
Replays xlog file to the specified server.
=item -R <lsn>, --rpl <lsn>
Acts as replica for the specified server.
=item -h, --help
Displays helpscreen and exits.
=back
=item -v, --version
Displays version and exits.
=back
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment