diff --git a/src/publish.rs b/src/publish.rs index 06bf722..564e8d3 100644 --- a/src/publish.rs +++ b/src/publish.rs @@ -126,6 +126,18 @@ fn visibility_arg(v: &str) -> Result<&str, String> { }) } +/// What the new visibility means, from the server's `status`. +fn visibility_note(visibility: &str, status: Option<&str>) -> &'static str { + match (visibility, status) { + ("public", Some("pending_review")) => ": pending review before it is listed publicly", + ("public", Some("accepted")) => ": listed publicly", + ("public", Some("rejected")) => ": rejected in review, so it is not listed", + ("unlisted", _) => ": anyone with the link can open it; not listed", + ("private", _) => ": only you can open it", + _ => "", + } +} + /// Server message for a failed call, plus the exit code it maps to. fn failure(status: u16, text: &str, what: &str) -> (String, i32) { let v: Value = serde_json::from_str(text).unwrap_or(Value::Null); @@ -458,7 +470,9 @@ fn apps_inner(parsed: &ParsedArgs, env: &BTreeMap) -> Result