Skip to content

Commit

Permalink
Explicitly configure ava --version value
Browse files Browse the repository at this point in the history
Fixes #2942.
  • Loading branch information
novemberborn committed Feb 6, 2022
1 parent 18c04f9 commit b9bf455
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/cli.js
Expand Up @@ -21,6 +21,7 @@ import {splitPatternAndLineNumbers} from './line-numbers.js';
import {loadConfig} from './load-config.js';
import normalizeModuleTypes from './module-types.js';
import normalizeNodeArguments from './node-arguments.js';
import pkg from './pkg.cjs';
import providerManager from './provider-manager.js';
import DefaultReporter from './reporters/default.js';
import TapReporter from './reporters/tap.js';
Expand Down Expand Up @@ -102,7 +103,7 @@ export default async function loadCli() { // eslint-disable-line complexity
let conf;
let confError;
try {
const {argv: {config: configFile}} = yargs(hideBin(process.argv)).help(false);
const {argv: {config: configFile}} = yargs(hideBin(process.argv)).help(false).version(false);
conf = await loadConfig({configFile});
if (conf.configFile && path.basename(conf.configFile) !== path.relative(conf.projectDir, conf.configFile)) {
console.log(chalk.magenta(` ${figures.warning} Using configuration from ${conf.configFile}`));
Expand Down Expand Up @@ -132,6 +133,7 @@ export default async function loadCli() { // eslint-disable-line complexity

let resetCache = false;
const {argv} = yargs(hideBin(process.argv))
.version(pkg.version)
.parserConfiguration({
'boolean-negation': true,
'camel-case-expansion': false,
Expand Down

0 comments on commit b9bf455

Please sign in to comment.