Skip to content

Commit b9bf455

Browse files
committed
Explicitly configure ava --version value
Fixes #2942.
1 parent 18c04f9 commit b9bf455

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/cli.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {splitPatternAndLineNumbers} from './line-numbers.js';
2121
import {loadConfig} from './load-config.js';
2222
import normalizeModuleTypes from './module-types.js';
2323
import normalizeNodeArguments from './node-arguments.js';
24+
import pkg from './pkg.cjs';
2425
import providerManager from './provider-manager.js';
2526
import DefaultReporter from './reporters/default.js';
2627
import TapReporter from './reporters/tap.js';
@@ -102,7 +103,7 @@ export default async function loadCli() { // eslint-disable-line complexity
102103
let conf;
103104
let confError;
104105
try {
105-
const {argv: {config: configFile}} = yargs(hideBin(process.argv)).help(false);
106+
const {argv: {config: configFile}} = yargs(hideBin(process.argv)).help(false).version(false);
106107
conf = await loadConfig({configFile});
107108
if (conf.configFile && path.basename(conf.configFile) !== path.relative(conf.projectDir, conf.configFile)) {
108109
console.log(chalk.magenta(` ${figures.warning} Using configuration from ${conf.configFile}`));
@@ -132,6 +133,7 @@ export default async function loadCli() { // eslint-disable-line complexity
132133

133134
let resetCache = false;
134135
const {argv} = yargs(hideBin(process.argv))
136+
.version(pkg.version)
135137
.parserConfiguration({
136138
'boolean-negation': true,
137139
'camel-case-expansion': false,

0 commit comments

Comments
 (0)