Spectre.Console: the application name in the usage description contains "dll"

Viewed 4

I am configuring Spectre.Console for the first time. Let's say the project name is "Awesome Console App", this is a console template, and I use AssemblyName tag, so .csproj file looks like this:

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net6.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>disable</Nullable>
    <AssemblyName>awesome-console-app</AssemblyName>
  </PropertyGroup>

The help output looks like this - I see the extension .dll under the usage line:

USAGE:
    awesome-console-app.dll [OPTIONS] <COMMAND>

OPTIONS:
    -h, --help       Prints help information
    -v, --version    Prints version information

COMMANDS:
    init

But I want to see "awesome-console-app" only, like in AssemblyName tag. How to achieve it?

1 Answers

You can configure CommandApp object like below, using SetApplicationName method:

var app = new CommandApp();
app.Configure(config =>
{
    config.SetApplicationName("awesome-console-app");
}

Applied to version 0.41.0.

Related