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

hide progress bar if quiet flag is on #38

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

SummerGram
Copy link
Contributor

Further work on #24

@@ -30,20 +31,23 @@ impl BasicRequestExecutor<CrosstermCliWriter, CrosstermCliWriter, CrosstermCliWr
if view_options.print_body_only {
BasicRequestExecutor {
request,
progress_draw_target: ProgressDrawTarget::stderr(),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead insert this ProgressDrawTarget in struct, use just a booleand field, like "show_loading". And check this value for hide or show the loading.

The CommandExecutor dependencies should be decoupled as possible of crate we are using to print stuff. If we need to change from Indicatif or Crossterm for another crate, the change doesn't be so painful.

@@ -105,6 +109,7 @@ where
let now = tokio::time::Instant::now();

let pb = ProgressBar::new(100);
pb.set_draw_target(self.progress_draw_target);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the check mentioned previously

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.

None yet

2 participants