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

Wrong args management for option --result #16

Closed
ThomasG77 opened this issue Feb 2, 2022 · 1 comment
Closed

Wrong args management for option --result #16

ThomasG77 opened this issue Feb 2, 2022 · 1 comment

Comments

@ThomasG77
Copy link
Contributor

I got an issue using the tool

I'm using Node 16.13 on an Ubuntu 18.04

Running the following does not work

npm install -g addok-geocode-stream

wget https://gist.githubusercontent.com/ThomasG77/32329a8557135f11cb5656e3bfd4d35c/raw/9bd7883be31d2c9758d4393d72e9dc1ae4c5bed3/annuaire-des-debits-de-tabac-2018-utf8.csv
cat annuaire-des-debits-de-tabac-2018-utf8.csv | addok-geocode --encoding utf8 --columns adresse,code_postal,commune --semicolon

It returns

Options:
  --help               Show help                                       [boolean]
  --version            Show version number                             [boolean]
  --service            Set geocoding service URL
                                   [default: "https://api-adresse.data.gouv.fr"]
  --columns            Select columns to geocode, in the right order
  --citycode           Filter results by citycode
  --postcode           Filter results by postcode
  --semicolon, --semi  Use semicolon (;) as separator                  [boolean]
  --tab                Use tabulation as separator                     [boolean]
  --pipe               Use pipe as separator                           [boolean]
  --result             Select columns you want to be added to the result by the
                       geocoder. Default: all
  --bucket             Set how many rows are sent in each request
                                                         [number] [default: 200]
  --concurrency        Set how many requests must be executed concurrently
                                                         [number] [default: "1"]
  --encoding           Set data encoding. Can be detected automatically
                                                     [choices: "utf8", "latin1"]

Cannot read properties of undefined (reading 'split')

It's due to trying to split on undefined on arg option --results.
I've made a commit on a branch to solve the issue ThomasG77@5a20037

Before making a PR, I needed to confirm with you my diagnostic.

@jdesboeufs
Copy link
Member

I agree with the problem and the solution 🙏

@jdesboeufs jdesboeufs changed the title Wrong args management for option --results Wrong args management for option --result Feb 17, 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

No branches or pull requests

2 participants