this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

start implementation of `full` flag for `status show`

+17 -11
+7 -3
src/main.rs
··· 179 179 handle: Option<String>, 180 180 181 181 /// Display raw status without processing 182 - #[arg(long, action)] 182 + #[arg(short, long, action)] 183 183 raw: bool, 184 + 185 + /// Display all status fields 186 + #[arg(short, long, action)] 187 + full: bool, 184 188 }, 185 189 } 186 190 ··· 362 366 } 363 367 }, 364 368 Commands::Status { command } => match command { 365 - StatusCommands::Show { handle, raw } => { 369 + StatusCommands::Show { handle, raw, full } => { 366 370 let ident = match handle { 367 371 Some(s) => s, 368 372 None => { ··· 374 378 375 379 let status_man = StatusManager::new(&ident); 376 380 let status = status_man.get_status().await?; 377 - status_man.display_status(&status, raw); 381 + status_man.display_status(&status, raw, full); 378 382 } 379 383 }, 380 384 }
+10 -8
src/status.rs
··· 2 2 use jacquard::{ 3 3 client::{AgentSessionExt, BasicClient}, 4 4 prelude::IdentityResolver, 5 - types::{ 6 - did::Did, 7 - string::{Datetime, Handle}, 8 - }, 5 + types::{did::Did, string::Handle}, 9 6 }; 10 7 use jacquard_api::fm_teal::alpha::actor::status as fm_teal_status; 11 8 use jacquard_identity::{JacquardResolver, PublicResolver}; 12 9 use owo_colors::OwoColorize; 13 - use serde_json::json; 14 10 15 11 use crate::error::OnyxError; 16 12 ··· 117 113 }) 118 114 } 119 115 120 - pub fn display_status(&self, status: &TrackStatus, raw: bool) { 116 + pub fn display_status(&self, status: &TrackStatus, raw: bool, full: bool) { 121 117 // if both track name and artists are blank, probably nothing's playing 122 - if status.track_name.is_empty() && status.artists.is_empty() { 118 + if status.track_name.is_empty() && status.artists.is_empty() && !raw { 123 119 println!("{}", "nothing playing right now".dimmed()); 124 120 return; 125 121 } 126 122 127 123 println!("{} {}", "track:".dimmed(), status.track_name.blue()); 128 124 129 - if !status.artists.is_empty() { 125 + if !status.artists.is_empty() || raw { 130 126 print!("{} ", "artists:".dimmed()); 131 127 132 128 for i in 0..status.artists.len() { ··· 182 178 183 179 println!("{} {}", "duration:".dimmed(), duration_str.green()); 184 180 } 181 + } 182 + 183 + if let Some(client) = &status.client_id 184 + && full 185 + { 186 + println!("{} {}", "client:".dimmed(), client.cyan()); 185 187 } 186 188 } 187 189 }