Skip to content

Commit e7f11f7

Browse files
committed
fix(@angular/cli): add --version option
This commit introduces the `--version` option, which will display the Angular CLI version when using `ng --version`. Closes #27668
1 parent a8ffecb commit e7f11f7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/angular/cli/src/command-builder/command-runner.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
} from './utilities/command';
2828
import { jsonHelpUsage } from './utilities/json-help';
2929
import { normalizeOptionsMiddleware } from './utilities/normalize-options-middleware';
30+
import { VERSION } from '../../lib/cli';
3031

3132
const yargsParser = Parser as unknown as typeof Parser.default;
3233

@@ -122,7 +123,7 @@ export async function runCommand(args: string[], logger: logging.Logger): Promis
122123
.demandCommand(1, demandCommandFailureMessage)
123124
.recommendCommands()
124125
.middleware(normalizeOptionsMiddleware)
125-
.version(false)
126+
.version(VERSION.full)
126127
.showHelpOnFail(false)
127128
.strict()
128129
.fail((msg, err) => {

0 commit comments

Comments
 (0)