MCPcopy Create free account
hub / github.com/VimYoung/Spell / look_value

Function look_value

spell-cli/src/main.rs:478–492  ·  view source on GitHub ↗
(layer_name: String, mut values: Args)

Source from the content-addressed store, hash-verified

476}
477
478async fn look_value(layer_name: String, mut values: Args) -> Result<(), SpellError> {
479 let remain_arg: String = values
480 .next()
481 .ok_or_else(|| SpellError::CLI(Cli::UndefinedArg("No variable name provided".to_string())))?
482 .clone();
483
484 let request = format!("look {}", remain_arg);
485 let path = format!("/tmp/{}_ipc.sock", layer_name.trim());
486 let mut stream = UnixStream::connect(path)?;
487 stream.write_all(request.as_bytes())?;
488 let mut value = String::new();
489 stream.read_to_string(&mut value)?;
490 println!("{value}");
491 Ok(())
492}
493
494async fn custom_called(layer_name: String, command: &str) -> Result<(), SpellError> {
495 let request = command.to_string();

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected