Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A new
omitStyles
function was added inpackages/tsargp/lib/styles.ts
to check the necessary environment variables:FORCE_COLOR
to emit styles even when the output is being redirectedNO_COLOR
to omit styles ifFORCE_COLOR
is not setTERM=dumb
to omit styles, if none of the previous variables was setNote that, if the terminal width is zero (or undefined), and
FORCE_COLOR
is not set, styles will be omitted regardless of the values of the other two variables.A new parameter was added to the
wrap
method of bothErrorMessage
andHelpMessage
classes:emitStyles
-boolean
- true if styles should be emitted - defaults to!omitStyles(width)
Likewise for the
wrapToWidth
method of theTerminalString
class, except that it is required in this case.Note
The
getAddMessage
function was removed from.changeset/commit.cjs
because thechangeset add
command was ignoring git commit failures, which might happen in the pre-commit hook. As a result, contributors will now have to commit the changeset file manually.Closes #21