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

Option request: remove color tag in CLI output #1

Closed
ehki opened this issue Sep 20, 2020 · 3 comments
Closed

Option request: remove color tag in CLI output #1

ehki opened this issue Sep 20, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@ehki
Copy link

ehki commented Sep 20, 2020

Thank you for managing this useful backup tool.

When I run the backupy on windows command prompt, the color tags are not properly displayed. This is because the color tags such as [94m, [0m, and [95m are not supported in windows command prompt. Some users (like me) who want to save the output into the file will face the same problem even in the Mac and Linux. Therefore, I'd like to suggest adding an option named for example nocolor to remove color tags from stdout. My backupy version and a minimal example follow:

Version:

$ pip freeze | grep BackuPy
BackuPy==1.8.2

Sample command:

mkdir srcdir dstdir; touch srcdir/test01.txt; backupy --noprompt srcdir dstdir > out.log

The contents of out.log:

�[94mScanning files on source:
MYTESTDIR/srcdir�[0m
Scanning 0/1:                                                                 
Scanning 1/1: test01.txt                                                      
Scanning completed!                                                           
�[94mScanning files on destination:
MYTESTDIR/dstdir�[0m
Scanning 0/0:                                                                 
Scanning completed!                                                           
�[94mComparing directories...�[0m
�[95mSource Only (will be copied to dest): 1 (0 B)�[0m
�[94mFile: �[0mtest01.txt
�[94m�[0m            �[94m Size: �[0m0 B       �[94m Modified: �[0mSun Sep 20 21:03:18 2020
�[95mDestination Only (will be archived): 0 (0 B)�[0m
�[95mChanged Files (archive dest and copy source -> dest): 0 (0 B)�[0m
�[95mMoved Files (will move files on dest to match source): 0 (0 B)�[0m
�[95mStarting mirror�[0m
�[94mCopying 1 unique files from:
MYTESTDIR/srcdir
to:
MYTESTDIR/dstdir�[0m
Copying 0/1:                                                                  
Copying 1/1: test01.txt                                                       
File operations completed!                                                    
�[92mCompleted!�[0m

If possible, the <0x1b> Esc character is preferred to be removed.

Best regard,

@elesiuta
Copy link
Owner

No problem, and thanks for the feedback.

This sounds like a good suggestion, I'll make the changes now.

elesiuta added a commit that referenced this issue Sep 21, 2020
@elesiuta elesiuta added the enhancement New feature or request label Sep 21, 2020
@elesiuta
Copy link
Owner

You can now use the --nocolour flag to achieve this, I'll probably be packaging a new release sometime this week or next, but the current revision is stable enough to use as is, and probably what will be packaged, nothing major has changed since 1.8.2.

@ehki
Copy link
Author

ehki commented Sep 22, 2020

I appreciate your quick response. Thank you so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants