-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to specify CLI version? #152
Comments
TLDR: var builder = CoconaApp.CreateBuilder();
builder.Services.AddSingleton<ICoconaApplicationMetadataProvider, ApplicationMetadataProvider>();
var app = builder.Build(); using Cocona.Application;
class ApplicationMetadataProvider : ICoconaApplicationMetadataProvider
{
public string GetDescription() => "Eru CLI";
public string GetExecutableName() => "EruCLI";
public string GetProductName() => "Eru Cli";
public string GetVersion() => "1.0.0.0";
}
I had the same question, this is what i found:
Idk if there is a cleaner api exposed or if you can just set the assembly attributes elsewhere, but I simply implemented the |
While you can provide a new implementation for the This means, you can also version your assembly by putting it in the <PropertyGroup>
<Version>1.2.3</Version>
</PropertyGroup> For use in CI/CD, you can provide Also, since .NET 8, the commit hash is included in the version by default. To disable this, simply add this to <PropertyGroup>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
</PropertyGroup> (learned this from https://anthonysimmon.com/remove-git-hash-from-assembly-informational-version-dotnet-8/) |
A
--version
flag is added by default to all CLIs. It prints[ExecutableName] 1.0.0
How does one specify the version of CLI?
The text was updated successfully, but these errors were encountered: