Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli: Show a message when there are no issues to display
Vincenzo Palazzo committed 3 years ago
commit 8d1bf9e99710931b4b05207cf4fdbd059ba1a1c6
parent 3ea7541d552f6b6207f571a86f26109149e7f8ac
2 files changed +10 -0
modified 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()),
modified 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<bool, Error> {
+
        Ok(self.count()? == 0)
+
    }
+

    /// Return objects count.
    pub fn count(&self) -> Result<usize, Error> {
        let raw = cob::list(self.repo, T::type_name())?;