Skip to main content

Interface: ApplicationText

The full set of static text and text-returning callbacks that are necessary for Stricli to write the necessary output.

Extends

Properties

briefs

readonly briefs: DocumentationBriefs

Short documentation brief strings used to build help text.

Inherited from

DocumentationText.briefs

Defined in

packages/core/src/text.ts:109


commandErrorResult()

readonly commandErrorResult: (err, ansiColor) => string

Formatted error message for the case where an Error was safely returned from the command. Users are most likely to hit this case, so make sure that the error text provides practical, usable feedback.

If ansiColor is true, this string can use ANSI terminal codes. Codes may have already been applied so be aware you may have to reset to achieve the desired output.

Parameters

err: Error

ansiColor: boolean

Returns

string

Inherited from

ApplicationErrorFormatting.commandErrorResult

Defined in

packages/core/src/text.ts:158


currentVersionIsNotLatest()

readonly currentVersionIsNotLatest: (args) => string

Generate warning text to be written to stdout when the latest version is not installed. Should include brief instructions for how to update to that version.

If ansiColor is true, this string can use ANSI terminal codes. Codes may have already been applied so be aware you may have to reset to achieve the desired output.

Parameters

args

args.ansiColor: boolean

args.currentVersion: string

args.latestVersion: string

args.upgradeCommand?: string

Returns

string

Defined in

packages/core/src/text.ts:202


exceptionWhileLoadingCommandContext()

readonly exceptionWhileLoadingCommandContext: (exc, ansiColor) => string

Formatted error message for the case where some exception was thrown while loading the context for the command run. This likely indicates an issue with the application itself or possibly the user's installation of the application.

If ansiColor is true, this string can use ANSI terminal codes. Codes may have already been applied so be aware you may have to reset to achieve the desired output.

Parameters

exc: unknown

ansiColor: boolean

Returns

string

Inherited from

ApplicationErrorFormatting.exceptionWhileLoadingCommandContext

Defined in

packages/core/src/text.ts:142


exceptionWhileLoadingCommandFunction()

readonly exceptionWhileLoadingCommandFunction: (exc, ansiColor) => string

Formatted error message for the case where some exception was thrown while loading the command function. This likely indicates an issue with the application itself or possibly the user's installation of the application.

If ansiColor is true, this string can use ANSI terminal codes. Codes may have already been applied so be aware you may have to reset to achieve the desired output.

Parameters

exc: unknown

ansiColor: boolean

Returns

string

Inherited from

ApplicationErrorFormatting.exceptionWhileLoadingCommandFunction

Defined in

packages/core/src/text.ts:134


exceptionWhileParsingArguments()

readonly exceptionWhileParsingArguments: (exc, ansiColor) => string

Formatted error message for the case where some exception was thrown while parsing the arguments.

Exceptions intentionally thrown by this library while parsing arguments will extend from ArgumentScannerError. These subclasses provide additional context about the specific error. Use the formatMessageForArgumentScannerError helper to handle the different error types.

If ansiColor is true, this string can use ANSI terminal codes. Codes may have already been applied so be aware you may have to reset to achieve the desired output.

Parameters

exc: unknown

ansiColor: boolean

Returns

string

Inherited from

ApplicationErrorFormatting.exceptionWhileParsingArguments

Defined in

packages/core/src/text.ts:126


exceptionWhileRunningCommand()

readonly exceptionWhileRunningCommand: (exc, ansiColor) => string

Formatted error message for the case where some exception was thrown while running the command. Users are most likely to hit this case, so make sure that the error text provides practical, usable feedback.

If ansiColor is true, this string can use ANSI terminal codes. Codes may have already been applied so be aware you may have to reset to achieve the desired output.

Parameters

exc: unknown

ansiColor: boolean

Returns

string

Inherited from

ApplicationErrorFormatting.exceptionWhileRunningCommand

Defined in

packages/core/src/text.ts:150


headers

readonly headers: DocumentationHeaders

Section header strings used to build help text.

Inherited from

DocumentationText.headers

Defined in

packages/core/src/text.ts:105


keywords

readonly keywords: DocumentationKeywords

Keyword strings used to build help text.

Inherited from

DocumentationText.keywords

Defined in

packages/core/src/text.ts:101


noCommandRegisteredForInput()

readonly noCommandRegisteredForInput: (args) => string

Formatted error message for the case where the supplied command line inputs do not resolve to a registered command. Supplied with arguments for the argument in question, and several possible corrections based on registered commands.

If ansiColor is true, this string can use ANSI terminal codes. Codes may have already been applied so be aware you may have to reset to achieve the desired output.

Parameters

args

args.ansiColor: boolean

args.corrections: readonly string[]

args.input: string

Returns

string

Inherited from

ApplicationErrorFormatting.noCommandRegisteredForInput

Defined in

packages/core/src/text.ts:172


noTextAvailableForLocale()

readonly noTextAvailableForLocale: (args) => string

Formatted error message for the case where the application does not provide text for the current requested locale. Should indicate that the default locale will be used instead.

If ansiColor is true, this string can use ANSI terminal codes. Codes may have already been applied so be aware you may have to reset to achieve the desired output.

Parameters

args

args.ansiColor: boolean

args.defaultLocale: string

args.requestedLocale: string

Returns

string

Inherited from

ApplicationErrorFormatting.noTextAvailableForLocale

Defined in

packages/core/src/text.ts:184