Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix commander not parsing arguments #66

Merged
merged 5 commits into from
Feb 13, 2022
Merged

Fix commander not parsing arguments #66

merged 5 commits into from
Feb 13, 2022

Conversation

ArFe
Copy link
Contributor

@ArFe ArFe commented Mar 29, 2021

Commander does not accept getting the options directly from program.
Need to create options variable.

Added this line (after .parse(process.argv) ):
const options = program.opts();

And replace program by options thereafter.

ArFe added 3 commits March 29, 2021 14:43
Commander does not accept getting the options directly from program. 
Need to create options variable.

Added this line (after   .parse(process.argv) ):
  const options = program.opts();

And replace program by options thereafter.
Fix commander not parsing arguments
Commander does not accept getting the options directly from program. 
Need to create options variable.

Added this line (after   .parse(process.argv) ):
  const options = program.opts();

And replace program by options thereafter.
dynamoDBtoCSV.js Outdated
console.log("You must specify a table");
program.outputHelp();
options.outputHelp();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's correct. options is doesn't have an outputHelp method. it's a program.OptionValue

@ArFe
Copy link
Contributor Author

ArFe commented Mar 29, 2021 via email

ArFe added 2 commits March 29, 2021 15:40
Add ProjectionExpression: options.select to the ScanQuery to fix --select not selecting specific fields if no primary key is presented.
@rafaelribeirokuhn
Copy link

rafaelribeirokuhn commented Apr 8, 2021

It took some time for me to figure out what was going on and to fix this error. I was going to open a PR exactly like this one when I saw it already has been made. I wish this PR has been merged before :(

@DollarAkshay
Copy link

DollarAkshay commented Apr 10, 2021

This should be merged into the main branch. I had the same issue and using the code in this branch worked

@houmie
Copy link

houmie commented Feb 13, 2022

Why has this not been merged yet? This project is not functional without this.

UPDATE: This seems now out of date. Merging it locally fails with this error:

undefined:1
undefined
^

SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at Object.<anonymous> (/Users/houmie/Projects/DynamoDBtoCSV/dynamoDBtoCSV.js:91:35)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47

Node.js v17.4.0

@edasque edasque merged commit 3b8d00f into edasque:master Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants