Metadata and startup message - adambajguz/Typin GitHub Wiki

Metadata

CliApplicationBuilder provides methods to sets some application metadata:

  • UseTitle(string title) - sets application title, which appears in the help text (default from entry assembly).
  • UseExecutableName(string executableName) - sets application executable name, which appears in the help text (default from entry assembly).
  • UseVersionText(string versionText) - sets application version text, which appears in the help text and when the user requests version information (default from entry assembly).
  • UseDescription(string description) - sets application description, which appears in the help text (default: null).

All above metadata can be access with DI-injectable singleton ApplicationMetadata.

Startup message

By default, there is no startup message defined in Typin, but user can specify it in CliApplicationBuilder using:

  • UseStartupMessage(string message, ConsoleColor messageColor = ConsoleColor.DarkYellow)
  • UseStartupMessage(Func<ApplicationMetadata, string> message, ConsoleColor messageColor = ConsoleColor.DarkYellow)
  • UseStartupMessage(Action<ApplicationMetadata, IConsole> message)

Different method overloads provide different levels of flexibility.