diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cli.rs | 11 | ||||
-rw-r--r-- | src/commands/db.rs | 4 |
2 files changed, 15 insertions, 0 deletions
@@ -292,6 +292,17 @@ pub fn cli<'a>() -> App<'a> { .arg(arg_older_than_date("List only jobs older than DATE")) .arg(arg_newer_than_date("List only jobs newer than DATE")) + + .arg(Arg::new("endpoint") + .required(false) + .multiple(false) + .long("endpoint") + .short('e') + .takes_value(true) + .value_name("ENDPOINT") + .about("Only show jobs from ENDPOINT") + ) + ) .subcommand(App::new("job") diff --git a/src/commands/db.rs b/src/commands/db.rs index 4ece20a..a296579 100644 --- a/src/commands/db.rs +++ b/src/commands/db.rs @@ -457,6 +457,10 @@ fn jobs(conn_cfg: DbConnectionConfig<'_>, matches: &ArgMatches) -> Result<()> { sel = sel.limit(limit) } + if let Some(ep_name) = matches.value_of("endpoint") { + sel = sel.filter(schema::endpoints::name.eq(ep_name)) + } + let data = sel .order_by(schema::jobs::id.desc()) // required for the --limit implementation .load::<(models::Job, models::Submit, models::Endpoint, models::Package)>(&conn)? |