Summary
elastic --version currently fails with an unknown option error. The version is only accessible via elastic version (a subcommand). Nearly all CLIs expose -V / --version as a root flag, and many users will try this by instinct.
Expected behaviour
$ elastic --version
0.1.1
$ elastic -V
0.1.1
Implementation
Commander supports this natively:
program.version(VERSION, '-V, --version', 'Print the elastic CLI version')
Add this call in src/cli.ts alongside the existing program.name(...) setup. The elastic version subcommand can remain for JSON output (elastic version --json).
Summary
elastic --versioncurrently fails with an unknown option error. The version is only accessible viaelastic version(a subcommand). Nearly all CLIs expose-V/--versionas a root flag, and many users will try this by instinct.Expected behaviour
Implementation
Commander supports this natively:
Add this call in
src/cli.tsalongside the existingprogram.name(...)setup. Theelastic versionsubcommand can remain for JSON output (elastic version --json).