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

-version with only one hyphen throws a ReferenceError #1254

Closed
bbrk24 opened this issue May 19, 2024 · 1 comment · Fixed by #1259
Closed

-version with only one hyphen throws a ReferenceError #1254

bbrk24 opened this issue May 19, 2024 · 1 comment · Fixed by #1259
Labels
bug Something isn't working cli Command-line interface issues

Comments

@bbrk24
Copy link
Contributor

bbrk24 commented May 19, 2024

$ civet -version
/home/bbrk24/.nvm/versions/node/v20.13.1/lib/node_modules/@danielx/civet/dist/civet:124
      args.splice(i, 1 + i - i, ...results);
                                   ^

ReferenceError: results is not defined
    at parseArgs (/home/bbrk24/.nvm/versions/node/v20.13.1/lib/node_modules/@danielx/civet/dist/civet:124:36)
    at cli (/home/bbrk24/.nvm/versions/node/v20.13.1/lib/node_modules/@danielx/civet/dist/civet:421:44)
    at Object.<anonymous> (/home/bbrk24/.nvm/versions/node/v20.13.1/lib/node_modules/@danielx/civet/dist/civet:635:3)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
    at node:internal/main/run_main_module:28:49

Node.js v20.13.1
@edemaine edemaine added the cli Command-line interface issues label May 19, 2024
@edemaine
Copy link
Collaborator

Root cause is this mistranslation in cli.civet:

      args[i..i] =
        for each char of arg[1..]
          `-${char}`
↓↓↓
      args.splice(i, 1 + i - i, ...results)

(Note: results isn't declared.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli Command-line interface issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants