#!/usr/bin/env node

const pg_kinesis_bridge = require("../pg-kinesis-bridge.js");

let args; {
	const argparse = require("argparse");
	const package_json = require("../package.json");
	const parser = new argparse.ArgumentParser({
		description: package_json.description,
		version: package_json.version,
		addHelp:true
	});
	parser.addArgument([ '-c', '--channel' ], {
		required: true,
		action: "append",
		help: 'PostgreSQL channel name'
	});
	parser.addArgument([ '-s', '--streamName' ], {
		required: true,
		help: 'Kinesis stream name'
	});
	args = parser.parseArgs();
}

let pkb = new pg_kinesis_bridge.PgKinesisBridge();
pkb.addStream(args.streamName);
args.channel.forEach((channel) => pkb.addChannel(channel));
pkb.connect()
	.catch((e) => {
		console.error(e);
		process.exit(1);
	});

@@ -506,16 +506,36 @@
 : true,%0A
+%09%09action: %22append%22,%0A
 %09%09help: 
@@ -643,16 +643,56 @@
 idge();%0A
+args.streamName.forEach((streamName) =%3E 
 pkb.addS
@@ -697,21 +697,16 @@
 dStream(
-args.
 streamNa
@@ -708,16 +708,17 @@
 eamName)
+)
 ;%0Aargs.c

Allow multiple stream arguments