/ crates / acdc / src / commands / configure.rs
configure.rs
 1  //! Configure command.
 2  
 3  use acdc_core::Config;
 4  use anyhow::Result;
 5  
 6  pub async fn run(node_id: Option<String>, list: bool) -> Result<()> {
 7      if list {
 8          let config = Config::load_default()?;
 9          if config.nodes.instances.is_empty() {
10              println!("No nodes configured.");
11          } else {
12              println!("Configured nodes:");
13              for node in &config.nodes.instances {
14                  println!(
15                      "  - {} ({}, {})",
16                      node.id,
17                      node.role,
18                      if node.enabled { "enabled" } else { "disabled" }
19                  );
20              }
21          }
22      } else if let Some(_id) = node_id {
23          println!("Node configuration will be implemented in Phase 3");
24      } else {
25          println!("Use --list to see configured nodes");
26      }
27      Ok(())
28  }