-
Notifications
You must be signed in to change notification settings - Fork 1
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
Refactored Display implementation for Platform enum #2
base: stable
Are you sure you want to change the base?
Refactored Display implementation for Platform enum #2
Conversation
Please make sure you have here only your files changed. It sees that you changed the line endings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- please make sure you have here only your files changed. It sees that you changed the line endings.
- please edit the title to reflect the meaning of this pull request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please modify the title of the pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command line utility might be used in scripts that do not want the graphic display. I suggest two solutions here:
- add a command line flag
- verify if you are running using a terminal (https://crates.io/crates/is-terminal) and display the drawn version or, if you are not running using a terminal - ie in a pipe, display the text version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, please send this to upstream and place a link to it here. Please explain the idea with the terminal in the pull request description.
|
WHOAMI
Key Changes:
Display Restructuring:
disp.rs
, to centralize and streamline platform-specific display functions.Aesthetic Enhancements:
To enhance the utility's adaptability, a crucial implementation has been added. The program checks whether it is running in a terminal environment (using https://crates.io/crates/is-terminal) before deciding how to display the platform. If executed in a terminal, the graphical version is presented; otherwise, in scenarios like running in a pipe, the text version is displayed.