Interface: ApplicationText
The full set of static text and text-returning callbacks that are necessary for Stricli to write the necessary output.
Extends
ApplicationErrorFormatting
.DocumentationText
Properties
briefs
readonly
briefs:DocumentationBriefs
Short documentation brief strings used to build help text.
Inherited from
DocumentationText.briefs
Defined in
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
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
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
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
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
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
headers
readonly
headers:DocumentationHeaders
Section header strings used to build help text.
Inherited from
DocumentationText.headers
Defined in
keywords
readonly
keywords:DocumentationKeywords
Keyword strings used to build help text.
Inherited from
DocumentationText.keywords
Defined in
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
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