diff --git a/cli/src/commands/invocations/list.rs b/cli/src/commands/invocations/list.rs index 4747d1b3f..df26d0981 100644 --- a/cli/src/commands/invocations/list.rs +++ b/cli/src/commands/invocations/list.rs @@ -35,6 +35,9 @@ pub struct List { /// Filter by invocation on this handler name #[clap(long, value_delimiter = ',')] handler: Vec, + /// Show all invocations, including the completed ones that are hidden by default. This overrides the `status` filter. + #[clap(long)] + all: bool, /// Filter by status(es) #[clap(long, ignore_case = true, value_delimiter = ',')] status: Vec, @@ -117,7 +120,13 @@ async fn list(env: &CliEnv, opts: &List) -> Result<()> { } // This is a post-filter as we filter by calculated column - if !statuses.is_empty() { + if opts.all { + // No filter + } else if statuses.is_empty() { + // Default hide completed invocations + post_filters.push("status != 'completed'".to_owned()); + } else { + // Apply status filters post_filters.push(format!( "status IN ({})", statuses.iter().map(|x| format!("'{}'", x)).format(",") diff --git a/cli/src/commands/invocations/mod.rs b/cli/src/commands/invocations/mod.rs index fc70ec8da..0250a4999 100644 --- a/cli/src/commands/invocations/mod.rs +++ b/cli/src/commands/invocations/mod.rs @@ -17,7 +17,7 @@ use cling::prelude::*; #[derive(Run, Subcommand, Clone)] pub enum Invocations { - /// List invocations of a service + /// List invocations List(list::List), /// Prints detailed information about a given invocation Describe(describe::Describe),