fix: report unsupported CLI operations honestly

This commit is contained in:
Loki 2026-10-16 23:15:33 +02:00
parent 622a5964f2
commit b741e042ac
Signed by: boba
GPG key ID: 6CDE87BC9A778D97
6 changed files with 14 additions and 37 deletions

View file

@ -1,14 +1,9 @@
pub async fn run(key: Option<String>, value: Option<String>) -> anyhow::Result<()> {
match (key, value) {
(Some(k), Some(v)) => {
println!("Setting {k} = {v}");
Ok(())
},
(Some(k), None) => {
println!("Reading config key: {k}");
println!("(not implemented in v0.1)");
Ok(())
(Some(_), Some(_)) => {
anyhow::bail!("config updates are not implemented; edit the edge config and restart Rampart")
},
(Some(_), None) => anyhow::bail!("config lookup is not implemented"),
(None, Some(_)) | (None, None) => {
println!("Configuration");
println!("=============\n");

View file

@ -1,7 +1,3 @@
pub async fn run(node: &str) -> anyhow::Result<()> {
println!("Draining node: {node}");
println!("Waiting for active connections to drain...");
tokio::time::sleep(std::time::Duration::from_secs(2)).await;
println!("Node {node} drained successfully.");
Ok(())
anyhow::bail!("graceful drain is not implemented for node {node}")
}

View file

@ -1,11 +1,7 @@
pub async fn enable() -> anyhow::Result<()> {
println!("Emergency mode ENABLED");
println!("Only whitelisted IPs will be allowed through.");
Ok(())
anyhow::bail!("emergency mode is not implemented; change the edge policy and restart Rampart")
}
pub async fn disable() -> anyhow::Result<()> {
println!("Emergency mode DISABLED");
println!("Normal filtering resumed.");
Ok(())
anyhow::bail!("emergency mode is not implemented; change the edge policy and restart Rampart")
}