summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2021-11-03 17:04:34 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2021-11-03 17:04:34 +0100
commit302a24afb2385dcbb161e331cce2ce0826c3c61a (patch)
treec52917fdf9806f5eaf016d9a0c9ddde3da89c4e8
parent3123a16b6793a209aa10b4e72b63729ae9a32e99 (diff)
downloadrebel-302a24afb2385dcbb161e331cce2ce0826c3c61a.tar
rebel-302a24afb2385dcbb161e331cce2ce0826c3c61a.zip
driver: change task reference string syntax to recipe:task@version/host:target
-rw-r--r--crates/driver/src/context.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/crates/driver/src/context.rs b/crates/driver/src/context.rs
index 1c8c0bd..9789e31 100644
--- a/crates/driver/src/context.rs
+++ b/crates/driver/src/context.rs
@@ -86,15 +86,19 @@ impl<'ctx> Display for TaskRef<'ctx> {
write!(f, "{}", self.id.recipe)?;
if let Some(pv) = pv_arg {
- write!(f, "-{}", pv)?;
+ write!(f, "@{}", pv)?;
}
write!(f, ":{}", self.id.task)?;
+ if host_arg.is_some() || target_arg.is_some() {
+ write!(f, "/")?;
+ }
+
if let Some(host) = host_arg {
- write!(f, "@{}", host.short)?;
+ write!(f, "{}", host.short)?;
}
if let Some(target) = target_arg {
- write!(f, "/{}", target.short)?;
+ write!(f, ":{}", target.short)?;
}
Ok(())
}
@@ -331,7 +335,7 @@ impl Context {
pub fn parse<'ctx>(&'ctx self, s: &str) -> error::Result<TaskRef> {
lazy_static! {
static ref RE: Regex = Regex::new(
- r"^(?P<recipe>[[:word:]-]+):(?P<task>[[:word:]-]+)(?:@(?P<host>[[:word:]-]+))?(?:/(?P<target>[[:word:]-]+))?$",
+ r"^(?P<recipe>[[:word:]-]+):(?P<task>[[:word:]-]+)(?:/(?P<host>[[:word:]-]+)?(?::(?P<target>[[:word:]-]+))?)?$",
).unwrap();
}