chore: better display

This commit is contained in:
mokurin000
2025-08-02 10:58:11 +08:00
parent 9e17df0624
commit c3010f2f10
2 changed files with 9 additions and 5 deletions

View File

@@ -49,8 +49,9 @@ pub enum Commands {
/// JSON format. /// JSON format.
/// ///
/// - `origin`: official json response /// `origin`: official json response
/// - `dx_rating_net`: DxRatingNet Format ///
/// `dx_rating_net`: DxRatingNet Format
#[arg(short, long, default_value_t = RatingFormat::default())] #[arg(short, long, default_value_t = RatingFormat::default())]
format: RatingFormat, format: RatingFormat,
}, },
@@ -61,8 +62,9 @@ pub enum Commands {
/// JSON format. /// JSON format.
/// ///
/// - `origin`: official json response /// `origin`: official json response
/// - `dx_rating_net`: DxRatingNet Format ///
/// `dx_rating_net`: DxRatingNet Format
#[arg(short, long, default_value_t = RatingFormat::default())] #[arg(short, long, default_value_t = RatingFormat::default())]
format: RatingFormat, format: RatingFormat,
}, },

View File

@@ -113,10 +113,12 @@ async fn main() -> Result<(), Box<dyn snafu::Error>> {
match (human_readable, format) { match (human_readable, format) {
(true, _) => { (true, _) => {
for detail in music_detail { for detail in &music_detail {
println!("{detail}"); println!("{detail}");
println!("----------"); println!("----------");
} }
println!("共查询到 {} 条记录!", music_detail.len());
} }
(false, RatingFormat::Origin) => json_display(music_detail)?, (false, RatingFormat::Origin) => json_display(music_detail)?,
(false, RatingFormat::DxRatingNet) => { (false, RatingFormat::DxRatingNet) => {