dotnet / dotnet/command-line-api

How do you customize the --version flag?

Open
#1,672 1 comment 0 reactions 0 assignees View on GitHub
needs documentation question
Dominant language
C#
Stars
3.7k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

The documentation [mentions](https://github.com/dotnet/command-line-api/blob/main/docs/Features-overview.md#version-option) that `System.CommandLine` supports the `--version` flag out of the box but it doesn't show how to override its default value, and I cannot find any method on the RootCommand class to set it.

Side suggestion 1: Change the default value from `1.0.0` to `0.1.0`. When an app follows semantic versioning its first release is usually very far from 1.0.

Side suggestion 2: Enable [GitHub Discussions](https://github.blog/2021-08-17-github-discussions-out-of-beta/) on the repo so that the community can ask ~obnoxious~ newbie questions like this one there and declutter the Issues section.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.