chore: better display
This commit is contained in:
@@ -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,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user