victorperin / qr-scanner-cli

A CLI tool to read QR Code from images
https://victorperin.github.io/qr-scanner-cli/
MIT License
69 stars 24 forks source link

[BUG] parsing bug (probably a regresson?) #195

Closed NightMachinery closed 2 years ago

NightMachinery commented 2 years ago
❯ qrscanner ./IMG_4428.jpg                                                               1
Options:
      --version    Show version number                                 [boolean]
  -c, --clear      Clear output, just print the QR Code scan result
                                                      [boolean] [default: false]
  -p, --clipboard  Copy the qr code value to your clipboard
                                                      [boolean] [default: false]
  -o, --open       Open the qr code value in any browser or program if support
                   it                                 [boolean] [default: false]
      --help       Show help                                           [boolean]

Examples:
  qrscanner ./qrCode.jpg          
                                  ╔══════════════════════════════════════════╗
                                  ║                                          ║
                                  ║   This message is written in a QR Code   ║
                                  ║                                          ║
                                  ╚══════════════════════════════════════════╝

  qrscanner ./qrCode.jpg --clear
                                  This message is written in a QR Code

Unknown argument: ./IMG_4428.jpg
victorperin commented 2 years ago

Thanks, for the the feedback, I'm looking it, I think this error occours in the validation, provided by yargs package. Can you try renaming it the image to something like image.jpg, and test it? I'll help me understand better if this is the responsable.

Also, could be a version of yargs incorrectly installed, I say it because I've got this kind of error before and it was related to it.

victorperin commented 2 years ago

Also, can you provide the output of qrscanner --version, please?

victorperin commented 2 years ago

image

Confirmed, this is occouring in the latest version. Working on a patch. :)

victorperin commented 2 years ago

@NightMachinary, I think I've fixed this, by updating yargs dependency.

This is quite new to me, since only occours installing the package globaly, maybe It's necessary to run a post release test to check if everything is ok or so.

Please, feel free to check the next generated version (2.1.4), to check if the error persists.

image From here seems to fixed.