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

Make use of coloured output #1

Open
jviotti opened this issue May 27, 2024 · 6 comments
Open

Make use of coloured output #1

jviotti opened this issue May 27, 2024 · 6 comments

Comments

@jviotti
Copy link
Member

jviotti commented May 27, 2024

See https://github.com/ikalnytskyi/termcolor

@Pavankumar07s
Copy link

Hii @jviotti may i work on this Feature.

@jviotti
Copy link
Member Author

jviotti commented Nov 4, 2024

Hi @Pavankumar07s ,

Yeah, feel free to send a PR, no need to ask for permission :) One thing to keep in mind would be to introduce a --no-color option, and potentially also check if you are running on a TTY or not, and disable color automatically!

@Pavankumar07s
Copy link

Alright @jviotti working on it .Thanks for instructions. 😀

@Pavankumar07s
Copy link

Hi @jviotti,

Just wanted to share a quick update on my progress:

1.Codebase Review: I've thoroughly reviewed the existing codebase.
2.Terminal Detection: I've implemented a mechanism to detect if the program is running in a terminal using #include <unistd.h>.
3.Colored Output: I've successfully implemented colored output for messages.
4.User Preference: I've added an option for users to toggle colored output on or off.
It would be great help to guide me for some further steps .
I am attaching some pic have a look.Going to more parts of code.Thankyou.
Screenshot from 2024-11-08 12-01-53

@jviotti
Copy link
Member Author

jviotti commented Nov 8, 2024

Hi @Pavankumar07s , great progress! I recommend trying to break down the work into as many small PRs as possible, so they are easier to review and polish. One potential way would be to:

  • Create a first PR that introduce the <unistd.h> approach on a helper in utils.h/utils.cc and maybe just uses it to color code "JSON Schema CLI vX.Y.Z" on the help page. Something super simple and without letting users control it yet
  • Once we have that merged, you can add support for the --no-color switch, and take of documenting it everywhere, etc
  • Once that is merged, you can send a PR for each command that you want to augment with colouring

@Pavankumar07s
Copy link

Alright @jviotti

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

No branches or pull requests

2 participants