summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@atos.net>2021-06-07 15:22:39 +0200
committerMatthias Beyer <matthias.beyer@atos.net>2021-06-07 15:53:50 +0200
commitc0609a050da45bdb93fbb5f2ad28055e1343c08f (patch)
tree588cb8e72ca89266d18bfeb611c3ed500e39aeed
parent810cc1c8281be8437ae0fd6257b2ea6190fe8d24 (diff)
Add flag to filter releases by store
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
-rw-r--r--src/cli.rs9
-rw-r--r--src/commands/db.rs4
2 files changed, 13 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs
index cdf35d3..6546b0f 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -408,6 +408,15 @@ pub fn cli<'a>() -> App<'a> {
.value_name("VERSION_CONSTRAINT")
.about("Limit search for package in version VERSION")
)
+
+ .arg(Arg::new("store")
+ .required(false)
+ .multiple(false)
+ .long("to")
+ .takes_value(true)
+ .value_name("STORE")
+ .about("List only releases to STORE")
+ )
)
)
diff --git a/src/commands/db.rs b/src/commands/db.rs
index 08ed6c8..ae2ba13 100644
--- a/src/commands/db.rs
+++ b/src/commands/db.rs
@@ -730,6 +730,10 @@ fn releases(conn_cfg: DbConnectionConfig<'_>, config: &Configuration, matches: &
.context("Parsing package version constraint")
.context("A valid package version constraint looks like this: '=1.0.0'")?;
+ if let Some(store) = matches.value_of("store") {
+ query = query.filter(schema::release_stores::dsl::store_name.eq(store));
+ }
+
let data = query
.select({
let art = schema::artifacts::all_columns;