statiqdev / Statiq.Framework

A flexible and extensible static content generation framework for .NET.
https://statiq.dev/framework
MIT License
421 stars 75 forks source link

'--help' CLI option throws error in Spectre.Console #180

Closed mthierba closed 3 years ago

mthierba commented 3 years ago

Running a Statiq.App (tested with Beta.38) with the --help command always results in this error message:

Error: Could not find color or style 'key'.

Having investigated this a bit, it is thrown at https://github.com/spectresystems/spectre.console/blob/0.37.0/src/Spectre.Console/Internal/Text/StyleParser.cs#L104.

Ultimately, this is caused by the Description attribute on BaseCommandSettings.Settings: https://github.com/statiqdev/Statiq.Framework/blob/v1.0.0-beta.38/src/core/Statiq.App/Commands/BaseCommandSettings.cs#L26. Spectre attempts to parse the [key]=[value] phrase as a markdown style, which fails.