Skip to content

feat: add --[no-]strip-ansi-codes option#782

Closed
srithon wants to merge 1 commit intocharmbracelet:mainfrom
srithon:main
Closed

feat: add --[no-]strip-ansi-codes option#782
srithon wants to merge 1 commit intocharmbracelet:mainfrom
srithon:main

Conversation

@srithon
Copy link
Copy Markdown
Contributor

@srithon srithon commented Dec 16, 2024

refs: #739, #188 (comment)

I chose to hide the conditional behind an interface to simplify the call sites and duplication of flag processing across commands. If we add further stdin-related options in the future, this would become more useful, as more logic would be abstracted away. However, I can see the argument against this approach; this pattern isn't used in the rest of the codebase (from what I saw), and adding it for such a small feature might not be worth the added complexity. In that case, it would be pretty easy to get rid of the interface and just inline the conditional in every command.

@srithon srithon marked this pull request as draft December 16, 2024 00:28
@srithon
Copy link
Copy Markdown
Contributor Author

srithon commented Dec 16, 2024

I realized that the fix for #689 was #739, and so it'll take more work than just re-enabling ANSI codes to make colored options work correctly.

@caarlos0 caarlos0 mentioned this pull request Dec 17, 2024
@caarlos0
Copy link
Copy Markdown
Contributor

did a slightly different implementation in #784

@caarlos0
Copy link
Copy Markdown
Contributor

merged #784

@caarlos0 caarlos0 closed this Dec 18, 2024
@caarlos0
Copy link
Copy Markdown
Contributor

thanks for the PR btw :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants