@@ -11,10 +11,10 @@ use std::{
1111} ;
1212
1313use anstream:: ColorChoice ;
14- use anstyle:: { AnsiColor , Style } ;
14+ use anstyle:: Style ;
1515use anyhow:: { Context , Error , Result , anyhow} ;
1616use clap:: { Args , CommandFactory , Parser , Subcommand , ValueEnum , builder:: PossibleValue } ;
17- use clap_cargo:: style:: { CONTEXT , HEADER } ;
17+ use clap_cargo:: style:: { CONTEXT , ERROR , GOOD , HEADER , TRANSIENT , WARN } ;
1818use clap_complete:: Shell ;
1919use futures_util:: stream:: StreamExt ;
2020use indicatif:: { MultiProgress , ProgressBar , ProgressStyle } ;
@@ -825,23 +825,13 @@ async fn check_updates(cfg: &Cfg<'_>, opts: CheckOpts) -> Result<ExitCode> {
825825 Style :: new ( )
826826 } ;
827827
828- let error = if use_colors {
829- AnsiColor :: Red . on_default ( ) . bold ( )
830- } else {
831- Style :: new ( )
832- } ;
828+ let transient = if use_colors { TRANSIENT } else { Style :: new ( ) } ;
833829
834- let good = if use_colors {
835- AnsiColor :: Green . on_default ( ) . bold ( )
836- } else {
837- Style :: new ( )
838- } ;
830+ let error = if use_colors { ERROR } else { Style :: new ( ) } ;
839831
840- let warn = if use_colors {
841- AnsiColor :: Yellow . on_default ( ) . bold ( )
842- } else {
843- Style :: new ( )
844- } ;
832+ let good = if use_colors { GOOD } else { Style :: new ( ) } ;
833+
834+ let warn = if use_colors { WARN } else { Style :: new ( ) } ;
845835
846836 // Ensure that `.buffered()` is never called with 0 as this will cause a hang.
847837 // See: https://github.com/rust-lang/futures-rs/pull/1194#discussion_r209501774
@@ -852,7 +842,9 @@ async fn check_updates(cfg: &Cfg<'_>, opts: CheckOpts) -> Result<ExitCode> {
852842 let channels = tokio_stream:: iter ( channels. into_iter ( ) ) . map ( |( name, distributable) | {
853843 let msg = format ! ( "{bold}{name} - {bold:#}" ) ;
854844 let status = "Checking..." ;
855- let template = format ! ( "{{msg}}{status} {{spinner:.green}}" ) ;
845+ let template = format ! (
846+ "{{msg}}{transient}{status}{transient:#} {transient}{{spinner}}{transient:#}"
847+ ) ;
856848 let pb = multi_progress_bars. add ( ProgressBar :: new ( 1 ) ) ;
857849 pb. set_style (
858850 ProgressStyle :: with_template ( template. as_str ( ) )
0 commit comments