Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: pretty printing without color #16

Merged
merged 1 commit into from
Oct 12, 2022
Merged

Conversation

Macroz
Copy link
Contributor

@Macroz Macroz commented Oct 12, 2022

Closes #15.

Introduce a new flag --color that decides whether colors are printed while pretty-printing is on. Valid values are on, off and auto, which is the default. In the future, there is the possibility of autodetecting from TTY settings, but at the time of writing auto means on.

The flags -c and -C can also be used to toggle color on/off respectively.

NB: Currently, only applies to EDN printing.

Additionally tests the pretty-printing with multiple line case, and ANSI color escape sequences.

I'm open for any kinds of suggestions and styling tips. I'm not sure if -c and -C options make sense. They introduce additional complexity, at least as implemented here. Also maybe handling of auto is extra. What do you think?

Introduce a new flag `--color` that decides whether colors are printed
while pretty-printing is on. Valid values are `on`, `off` and `auto`,
which is the default. In the future, there is the possibility of
autodetecting from TTY settings, but at the time of writing `auto`
means `on`.

The flags `-c` and `-C` can also be used to toggle color on/off respectively.

NB: Currently, only applies to EDN printing.

Additionally tests the pretty-printing with multiple line case, and
ANSI color escape sequences.
Copy link
Owner

@markus-wa markus-wa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great! thanks for the contribution 😄

@markus-wa markus-wa merged commit 19c6c08 into markus-wa:main Oct 12, 2022
@Macroz Macroz deleted the color-option branch October 12, 2022 14:22
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.

Pretty indendation and coloring should be separate options
2 participants