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

Refactored Display implementation for Platform enum #2

Open
wants to merge 8 commits into
base: stable
Choose a base branch
from

Conversation

sebihutanu
Copy link

@sebihutanu sebihutanu commented Jan 21, 2024

WHOAMI

Key Changes:

  1. Display Restructuring:

    • Significantly restructured the Display implementation for the Platform type.
    • Introduced a dedicated file, disp.rs, to centralize and streamline platform-specific display functions.
  2. Aesthetic Enhancements:

    • Revamped the platform display, focusing on enhancing the overall aesthetic.
    • Resulting in a more visually appealing output for improved user experience.

    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.

@alexandruradovici
Copy link

Please make sure you have here only your files changed. It sees that you changed the line endings.

Copy link

@alexandruradovici alexandruradovici left a 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

Copy link

@alexandruradovici alexandruradovici left a 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.

.vs/ProjectSettings.json Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
Copy link

@alexandruradovici alexandruradovici left a 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

@sebihutanu sebihutanu changed the title WHOAMI contribution Refactored Display implementation for Platform enum Jan 22, 2024
Copy link

@alexandruradovici alexandruradovici left a 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.

@sebihutanu
Copy link
Author

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.

ardaku#83

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

Successfully merging this pull request may close these issues.

3 participants