Comments (3)
Hey! Yeah I’m definitely in favour of doing this if possible. This would be a great clean up 🧹. This code was added before ratatui existed, and if they have the same functionality then we should use it.
Regarding the differences in name conventions, we could add a switch statement to convert “light-red” to “lightred” or make a PR to add these aliases to ratatui?
from gping.
The difference in the error caption:
ratatui: Failed to parse Colors
gping: Invalid color code: `{}`
This error is easy to wrap & handle:
error => Some(error.map_err(|err| {
anyhow!(err).context(format!("Invalid color code: `{}`", name))
})),
> ./gping www.google.com www.baidu.com -c "red,yello" 07/10/2023 03:32:12 PM
Error: Invalid color code: `yello`
Caused by:
Failed to parse Colors
Or even simpler:
_ => Some(Err(anyhow!("Invalid color code: `{}`", name))),
> ./gping www.google.com www.baidu.com -c "red,yello" 1 07/10/2023 03:32:17 PM
Error: Invalid color code: `yello`
Which case would like @orf?
The difference in the color name conventions:
ratatui: "lightred" | "light red"
gping: "light-red"
from gping.
Hey! Yeah I’m definitely in favour of doing this if possible. This would be a great clean up broom. This code was added before ratatui existed, and if they have the same functionality then we should use it.
Regarding the differences in name conventions, we could add a switch statement to convert “light-red” to “lightred” or make a PR to add these aliases to ratatui?
I'm not sure because the naming convention may not be a standard for the framework, we can definitely work around it by replacing the -
, and I'll try to ask for opinions from upstream~
Personally, I believe ratatui is not very mature in this part, because some same colors can have different expressions in their enum model. That would be way too much to discuss.
from gping.
Related Issues (20)
- What's the meaning of jtr HOT 1
- [RFE] ping a CIDR
- [Feature Request] Tab completion for the hostname HOT 1
- How do I build gping? HOT 3
- x86_64 musl build no longer provided? HOT 4
- How to build the image with the Dockerfile? HOT 5
- Update gping snap HOT 1
- Unable to install gping using Ubuntu/Debian (Azlux's repo) HOT 1
- Consider adding separation when stats are maximally compressed
- NetBSD package HOT 1
- I really like your project but I'm a Gopher and I'm still working on this little tool (ggping), can you help me add some friend chains HOT 1
- debian gping binary not exists HOT 2
- Does it also support TCP pings? HOT 1
- Print graph with special color/marker for failed commands HOT 1
- Installed ping is not supported: Please use iputils ping, not inetutils HOT 1
- Choose a more sensible default interval on OpenBSD. HOT 1
- Add option for packet size
- Unable to compile due to type inference issue on rustc 1.74.0 or higher HOT 1
- Cargo install gping fails with "type annotations needed" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gping.