1

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 Answers1

2

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.

  • Yes, the default is the "entrypoint" i.e. [the name of the dll/exe](https://github.com/spectreconsole/spectre.console/blob/78d841e3dcbfffcb2003f92bf32c436e6e714f7e/src/Spectre.Console.Cli/Internal/Modelling/CommandModel.cs#L32). Setting the `ApplicationName` overrides this. – Nils Sep 18 '22 at 18:40