rich icon indicating copy to clipboard operation
rich copied to clipboard

[REQUEST] Diff Tool Enhanced

Open onlyacat opened this issue 1 year ago • 3 comments

How would you improve Rich?

It is easy to diff two files or two texts and receive highlighting results in the terminal with tools like diff or git-diff. But it is hard to finish during the python process. Even though Python provides a native library called difflib, still it is a long way to go to print the result in the console simply.

I would like to know will the rich support this function.

What problem does it solve for you? This could simply be the whole process with fewer libraries and the diff results can be reorganized with the whole pipeline. Thus the result can be printed easily by rich.Console. The whole process may be like:

import rich

a = "123"
b = "1234"

rich.print(rich.diff(a,b))

Also, it can be invoked in the terminal. Like:

python3 -m rich.diff t1.txt t2.txt

onlyacat avatar Mar 13 '24 08:03 onlyacat

Thank you for your issue. Give us a little time to review it.

PS. You might want to check the FAQ if you haven't done so already.

This is an automated reply, generated by FAQtory

github-actions[bot] avatar Mar 13 '24 08:03 github-actions[bot]