diff --git a/radicle-cli/src/commands/issue.rs b/radicle-cli/src/commands/issue.rs index 2ec56840..3ad39c42 100644 --- a/radicle-cli/src/commands/issue.rs +++ b/radicle-cli/src/commands/issue.rs @@ -325,6 +325,11 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> { } } Operation::List { assigned } => { + if issues.is_empty()? { + term::print(term::format::italic("Nothing to show.")); + return Ok(()); + } + let assignee = match assigned { Some(Assigned::Me) => Some(*profile.id()), Some(Assigned::Peer(id)) => Some(id.into()), diff --git a/radicle/src/cob/store.rs b/radicle/src/cob/store.rs index 98658a30..ad44befa 100644 --- a/radicle/src/cob/store.rs +++ b/radicle/src/cob/store.rs @@ -223,6 +223,11 @@ where })) } + /// Return true if the list of issues is empty. + pub fn is_empty(&self) -> Result { + Ok(self.count()? == 0) + } + /// Return objects count. pub fn count(&self) -> Result { let raw = cob::list(self.repo, T::type_name())?;