chore: better display
This commit is contained in:
@@ -49,8 +49,9 @@ pub enum Commands {
|
||||
|
||||
/// JSON format.
|
||||
///
|
||||
/// - `origin`: official json response
|
||||
/// - `dx_rating_net`: DxRatingNet Format
|
||||
/// `origin`: official json response
|
||||
///
|
||||
/// `dx_rating_net`: DxRatingNet Format
|
||||
#[arg(short, long, default_value_t = RatingFormat::default())]
|
||||
format: RatingFormat,
|
||||
},
|
||||
@@ -61,8 +62,9 @@ pub enum Commands {
|
||||
|
||||
/// JSON format.
|
||||
///
|
||||
/// - `origin`: official json response
|
||||
/// - `dx_rating_net`: DxRatingNet Format
|
||||
/// `origin`: official json response
|
||||
///
|
||||
/// `dx_rating_net`: DxRatingNet Format
|
||||
#[arg(short, long, default_value_t = RatingFormat::default())]
|
||||
format: RatingFormat,
|
||||
},
|
||||
|
||||
@@ -113,10 +113,12 @@ async fn main() -> Result<(), Box<dyn snafu::Error>> {
|
||||
|
||||
match (human_readable, format) {
|
||||
(true, _) => {
|
||||
for detail in music_detail {
|
||||
for detail in &music_detail {
|
||||
println!("{detail}");
|
||||
println!("----------");
|
||||
}
|
||||
|
||||
println!("共查询到 {} 条记录!", music_detail.len());
|
||||
}
|
||||
(false, RatingFormat::Origin) => json_display(music_detail)?,
|
||||
(false, RatingFormat::DxRatingNet) => {
|
||||
|
||||
Reference in New Issue
Block a user