Repository navigation
Commit da11b64
Add a --version flag to the pulumi command (#23898)
`pulumi --version` previously failed with "unknown flag"; the version
was only available via the `pulumi version` subcommand. This wires up
cobra's built-in version handling by setting the root command's
`Version` field, with a version template so `pulumi --version` prints
exactly the same output as `pulumi version` (just the version string).
Notes:
- The persistent `--verbose`/`-v` shorthand is unaffected: cobra only
claims `-v` for `--version` when the shorthand is free, so `--version`
gets no shorthand.
- Cobra handles `--version` before `PersistentPreRunE`, so `pulumi
--version` skips the async update check that `pulumi version` triggers,
which seems desirable for a plain version query.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Fable 5 <[email protected]>1 parent 03bf3a8 commit da11b64
3 files changed
Lines changed: 23 additions & 0 deletions
File tree
- changelog/pending
- pkg/cmd/pulumi
- tests/smoke
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| 263 | + | |
263 | 264 | | |
264 | 265 | | |
265 | 266 | | |
| |||
444 | 445 | | |
445 | 446 | | |
446 | 447 | | |
| 448 | + | |
| 449 | + | |
447 | 450 | | |
448 | 451 | | |
449 | 452 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1366 | 1366 | | |
1367 | 1367 | | |
1368 | 1368 | | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
0 commit comments