Rust

Crate root

Module
What utopia_cli defines at its root.

Modules

Contents

use utopia_cli::Cli;
Rust
pub struct Cli

A command-line application.

Also implements Debug.
use utopia_cli::Task;
Rust
pub struct Task

A command a Cli runs: a Hook with a name. It dereferences to its hook, so the hook's setters and getters apply to it.

Rust
use serde_json::json;
use utopia_cli::Task;

let mut task = Task::new("test");
task.desc("test task").label("key", json!("value"));
assert_eq!(task.name(), "test");
assert_eq!(task.description(), "test task");
assert_eq!(task.get_label("key"), Some(&json!("value")));
Also implements Deref, DerefMut.
Rust
pub type Args = IndexMap<String, Value>

A parsed argument value: a string, null for --key without =, or a list of those for a key given several times.