Beispiel #1
0
int main(int argc, char *argv[], char *envp[])
{
	tc_init();
	enum tc_opt_mode mode =
		tc_opt_init(&tc.opt, argc, argv, envp);

	/*tc_validate();*/

	int rc = 0;
	switch (mode) {
	case TC_OPT_USAGE:
		tc_opt_usage();
		break;
	case TC_OPT_VERSION:
		tc_opt_version();
		break;
	case TC_OPT_WAL_CAT:
		rc = tc_store_cat();
		break;
#if 0
	case TC_OPT_RPL:
		tc_connect();
		rc = tc_store_remote();
		break;
	case TC_OPT_WAL_PLAY:
		tc_connect();
		rc = tc_store_play();
		break;
#endif
	case TC_OPT_CMD:
		tc_connect();
		rc = tc_clicmdv();
		break;
	case TC_OPT_INTERACTIVE:
		tc_connect();
		tc_motd();
		rc = tc_cli();
		break;
	}

	tc_shutdown();
	return rc;
}
Beispiel #2
0
int main(int argc, char *argv[])
{
	tc_init();

	int rc;
	enum tc_opt_mode mode = tc_opt_init(&tc.opt, argc, argv);
	switch (mode) {
	case TC_OPT_USAGE:
		tc_opt_usage();
		break;
	case TC_OPT_RPL:
		tc_connect();
		rc = tc_wal_remote();
		break;
	case TC_OPT_WAL_CAT:
		rc = tc_wal_cat();
		break;
	case TC_OPT_WAL_PLAY:
		tc_connect();
		rc = tc_wal_play();
		break;
	case TC_OPT_CMD:
		tc_connect();
		tc_connect_admin();
		rc = tc_cli_cmdv();
		break;
	case TC_OPT_INTERACTIVE:
		tc_connect();
		tc_connect_admin();
		rc = tc_cli();
		break;
	}

	tc_free();
	return rc;
}