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

Use ANSI styling in output #5

Closed
ericcornelissen opened this issue Apr 27, 2023 · 1 comment · Fixed by #13
Closed

Use ANSI styling in output #5

ericcornelissen opened this issue Apr 27, 2023 · 1 comment · Fixed by #13
Assignees
Labels
enhancement New feature or request

Comments

@ericcornelissen
Copy link
Owner

ericcornelissen commented Apr 27, 2023

Feature Request

Summary

By virtue of using clap, help and usage messaging is already ANSI styled. The software's own output could be improved by using ANSI styling as well. From the Command Line Interface Guidelines:

Use color with intention. For example, you might want to highlight some text so the user notices it, or use red to indicate an error. Don’t overuse it—if everything is a different color, then the color means nothing and only makes it harder to read.

Given the rather simple nature of this software, my suggestion would be to limit the use of ANSI styling to highlighting important information (e.g. what file system entry a line is about) or dimming optional information (e.g. error tips).

Suggestion

The following snippet aims to give an idea of how ANSI styling can be used to improve the software output. This suggestion is not necessarily complete nor final.

Note: Using HTML tags to give an idea of what would be styled, not necessarily how. Using <b> to indicate something deserves emphasis, <i> to dim text.

$ rm example_file example_dir
Would remove <b>example_file</b>
Cannot remove <b>example_dir</b>: Is a directory <i>(use '--dir' to remove)</i>

<b>1</b> would be removed <i>(use '--force' to remove)</i>, <b>1</b> error occurred

$ rm example_file example_dir --dir
Would remove <b>example_file</b>
Would remove <b>example_dir</b>

<b>2</b> would be removed <i>(use '--force' to remove)</i>, <b>0</b> errors occurred

$ rm example_file example_dir --dir --force
Removed <b>example_file</b>
Removed <b>example_dir</b>

<b>2</b> Removed, <b>0</b> errors occurred

Requirements

@ericcornelissen
Copy link
Owner Author

ericcornelissen commented Apr 29, 2023

While closed, suggestions for improvements/additions/changes to ANSI styling in the software's output are welcome. Either leave a comment here or create a new issue 🙂

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

Successfully merging a pull request may close this issue.

1 participant