diff --git a/dynamoDBtoCSV.js b/dynamoDBtoCSV.js index 8661b07..836d535 100644 --- a/dynamoDBtoCSV.js +++ b/dynamoDBtoCSV.js @@ -35,8 +35,8 @@ program const options = program.opts(); if (!options.table) { - console.log("You must specify a table"); - program.outputHelp(); + console.error("You must specify a table"); + program.outputHelp({ error: true }); process.exit(1); } @@ -77,7 +77,7 @@ if (options.mfa && options.profile) { // Update config to include MFA AWS.config.update({ credentials: creds }); } else if (options.mfa && !options.profile) { - console.log('error: MFA requires a profile(-p [profile]) to work'); + console.error('error: MFA requires a profile(-p [profile]) to work'); process.exit(1); } @@ -168,9 +168,9 @@ const appendStats = (params, items) => { const printStats = (stats) => { if (stats) { - console.log("\nSTATS\n----------"); + console.error("\nSTATS\n----------"); Object.keys(stats).forEach((key) => { - console.log(key + " = " + stats[key]); + console.error(key + " = " + stats[key]); }); writeCount += rowCount; rowCount = 0; @@ -237,8 +237,8 @@ const unparseData = (lastEvaluatedKey) => { console.log(endData); } // Print last evaluated key so process can be continued after stop. - console.log("last key:"); - console.log(lastEvaluatedKey); + console.error("last key:"); + console.error(lastEvaluatedKey); // reset write array. saves memory unMarshalledArray = [];