mrodrig / json-2-csv

Convert JSON to CSV *or* CSV to JSON!
https://mrodrig.github.io/json-2-csv
MIT License
415 stars 57 forks source link

CLI `csv2json -h` results in an error #262

Open porg opened 3 weeks ago

porg commented 3 weeks ago

Reproduction

Expected Behavior

Actual Behavior

$ json2csv --help

# Shows the help screen fine

$ json2csv -h    

# Shows the help screen fine

$ csv2json --help

# Shows the help screen fine

$ csv2json -h    
/usr/local/lib/node_modules/@mrodrig/json-2-csv-cli/node_modules/commander/lib/command.js:581
      throw err;
      ^

TypeError: Cannot read properties of undefined (reading 'split')
    at Option.constructKeysList [as parseArg] (/usr/local/lib/node_modules/@mrodrig/json-2-csv-cli/bin/utils/utils.js:88:17)
    at Command._callParseArg (/usr/local/lib/node_modules/@mrodrig/json-2-csv-cli/node_modules/commander/lib/command.js:575:21)
    at handleOptionValue (/usr/local/lib/node_modules/@mrodrig/json-2-csv-cli/node_modules/commander/lib/command.js:674:20)
    at Command.<anonymous> (/usr/local/lib/node_modules/@mrodrig/json-2-csv-cli/node_modules/commander/lib/command.js:694:7)
    at Command.emit (node:events:520:28)
    at Command.parseOptions (/usr/local/lib/node_modules/@mrodrig/json-2-csv-cli/node_modules/commander/lib/command.js:1689:18)
    at Command._parseCommand (/usr/local/lib/node_modules/@mrodrig/json-2-csv-cli/node_modules/commander/lib/command.js:1449:25)
    at Command.parse (/usr/local/lib/node_modules/@mrodrig/json-2-csv-cli/node_modules/commander/lib/command.js:1064:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/@mrodrig/json-2-csv-cli/bin/csv2json.js:23:6)
    at Module._compile (node:internal/modules/cjs/loader:1504:14)

Node.js v22.5.1

$

Background Information

The issue I'm reporting is with:

I have...

porg commented 10 hours ago

@mrodrig it's a minor bug but still I'd appreciate a reaction. Thanks!