Skip to content

Conversation

@steel-bucket
Copy link
Contributor

Added the CLI Tool feature

image

For installation run

$ cargo install --path . --locked

For usage

$ command_timeout -c "curl https://www.google.com/" -f  "/path/to/config.toml"

OR

$ command_timeout 
$ Enter your Command - curl https://www.google.com/
$ Enter your config location - /path/to/config.toml

Example of config.toml

minimum_timeout_ms = 500
maximum_timeout_ms = 10000
activity_timeout_ms = 2000

@steel-bucket
Copy link
Contributor Author

@cfsmp3 Please review this PR if possible. It's complete, I used a config file here, I could replace it with the 3 parameters being asked for directly.

@cfsmp3
Copy link
Owner

cfsmp3 commented Apr 12, 2025

@cfsmp3 Please review this PR if possible. It's complete, I used a config file here, I could replace it with the 3 parameters being asked for directly.

I don't want to replace tracing with println. Why would we do that?

@steel-bucket
Copy link
Contributor Author

steel-bucket commented Apr 12, 2025

@cfsmp3 Okay, I have replaced println or eprintln with tracing::info. I used println before as tracing added the dates which looked bad. The one used now has the dates and INFO tag removed. I did use print once, as info adds a linebreak everytime.
We could also use crates like colored or yansi for Coloured and Bold Text in the CLI tool.

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.

2 participants