Description
The npm-published version of @vedanth/context7@1.0.2 is missing the --version/-v flag handling in bin/c7.js.
Expected Behavior
$ c7 --version
1.0.2
$ c7 -v
1.0.2
Actual Behavior
Both flags are silently ignored and the argument is treated as a library name query:
$ c7 --version
# → fetches docs for "version" (e.g. version_utils Python package)
$ c7 -v
# → fetches docs for "v" (V programming language)
Root Cause
The parseArgs function in bin/c7.js is missing the --version/-v branch, and the main function is missing the early-exit check:
// Missing in parseArgs:
else if (a === '--version' || a === '-v') { args.version = true; }
// Missing in main():
if (opts.version) {
const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
console.log(pkg.version);
process.exit(0);
}
These lines exist in the GitHub repo source but were apparently omitted from the npm-published tarball. A re-publish (npm publish) should resolve it.
Fix
The lines above need to be added at:
parseArgs (bin/c7.js line ~36): add the --version/-v branch after the --json branch
main (bin/c7.js line ~97): add the opts.version early-exit block before the opts.help check
Both are already present in the GitHub repo — they just need to be included in the next npm publish.
Description
The npm-published version of
@vedanth/context7@1.0.2is missing the--version/-vflag handling inbin/c7.js.Expected Behavior
Actual Behavior
Both flags are silently ignored and the argument is treated as a library name query:
Root Cause
The
parseArgsfunction inbin/c7.jsis missing the--version/-vbranch, and the main function is missing the early-exit check:These lines exist in the GitHub repo source but were apparently omitted from the npm-published tarball. A re-publish (
npm publish) should resolve it.Fix
The lines above need to be added at:
parseArgs(bin/c7.jsline ~36): add the--version/-vbranch after the--jsonbranchmain(bin/c7.jsline ~97): add theopts.versionearly-exit block before theopts.helpcheckBoth are already present in the GitHub repo — they just need to be included in the next npm publish.