bin_efo/commands/
show.rs

1//! The show commands
2//! Used to display structures with various degree of verbosity
3
4use clap::Subcommand;
5use lib_efo::{Displayable, entity::Entity, naming::NAMING};
6
7use crate::error::AppError;
8#[derive(Subcommand, Debug)]
9/// Show command
10pub enum ShowCmd {
11    /// Show an event
12    Event,
13    /// Show an event
14    Character,
15    /// Show an event
16    Town,
17}
18
19// #[derive(Args)]
20// struct Specifics {
21//     name: String,
22// }
23
24/// Handle all show cmds
25pub fn handle_show_cmd(cmd: &ShowCmd) -> Result<(), AppError> {
26    let _ = cmd;
27    let mut e = Entity::default();
28    e.name = NAMING.generate_long_character_name();
29    println!("Original Struct: \n{e:#?}");
30    println!("\n\n\nONELINES");
31    println!("{}", e.oneline_display());
32    println!("{}", e.oneline_display());
33    println!("{}", e.oneline_display());
34    println!("{}", e.oneline_display());
35    println!("{}", e.oneline_display());
36    println!("{}", e.oneline_display());
37    println!("{}", e.oneline_display());
38    println!("\n\n\n SHORT");
39    e.print_short();
40
41    println!("\n\n\n LONG");
42    e.print_full();
43    println!("\n\n\n TREE");
44    println!("{}", e.to_pretty_tree());
45
46    Ok(())
47}
48
49// Show event
50// Show diff (char/town)
51// Show ....