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 argument is bugged #3

Closed
fluentinstroll opened this issue Sep 24, 2020 · 1 comment
Closed

Version argument is bugged #3

fluentinstroll opened this issue Sep 24, 2020 · 1 comment

Comments

@fluentinstroll
Copy link

When the user inputs "node lab1.js -v" or "--version", the app gives an error.

PS C:\Users\raymo\Documents\3yearseneca\OSD600\testingrepos\OSD600-Release0.1\BrokenLinkChecker- Release 0.1> node lab1.js -v
internal/fs/utils.js:269
    throw err;

Error: ENOENT: no such file or directory, open '-v'
    at Object.openSync (fs.js:462:3)
    at Object.readFileSync (fs.js:364:35)
    at Object.<anonymous> (C:\Users\raymo\Documents\3yearseneca\OSD600\testingrepos\OSD600-Release0.1\BrokenLinkChecker- Release 0.1\lab1.js:29:23)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: '-v'
}

I suggest changing the arguments checker to this:

if (process.argv[2] == **"-v"** || process.argv[2] == **"--version"**) {
        console.log(packageJson.name + " Version " + packageJson.version);
    }

from what it was originally

@joey2031 joey2031 reopened this Sep 24, 2020
@joey2031
Copy link
Owner

joey2031 commented Sep 24, 2020

I did not choose that option I did the other one: running the tool with the v or version argument should print the name of the tool and its version

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