@@ -64,8 +64,8 @@ mod utils;
static USAGE: &'static str = "
Usage:
- snowpatch <config-file> [--count=<count> | --series <id>]
- snowpatch <config-file> --mbox=<mbox> --project=<name>
+ snowpatch <config-file> [--count=<count> | --series <id>] [--project <name>]
+ snowpatch <config-file> --mbox <mbox> --project <name>
snowpatch -v | --version
snowpatch -h | --help
@@ -74,8 +74,8 @@ By default, snowpatch runs as a long-running daemon.
Options:
--count <count> Run tests on <count> recent series.
--series <id> Run tests on the given Patchwork series.
- --mbox <mbox> Run tests on the given mbox file...
- --project <name> ...as if it were sent to project <name>.
+ --mbox <mbox> Run tests on the given mbox file. Requires --project
+ --project <name> Test patches for the given project.
-v, --version Output version information.
-h, --help Output this help text.
";
@@ -325,6 +325,13 @@ fn main() {
continue;
}
+ // Skip if we're using -p and it's the wrong project
+ if args.flag_project != "" && series.project.linkname != args.flag_project {
+ debug!("Skipping series {} ({}) (wrong project: {})",
+ series.name, series.id, series.project.linkname);
+ continue;
+ }
+
match settings.projects.get(&series.project.linkname) {
None => {
debug!("Project {} not configured for series {} ({})",
A user may want to run snowpatch in normal patchwork polling mode, but only test one particular project. Expand the --project flag so it can be used for this case. Closes: #22 ("Allow use of --project switch in normal mode, not just with --mbox") Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> --- V1->V2: * Fix build --- src/main.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)