$HOST contains the name of the host. This is useful for
example if you want to transfer data to the host by rsync.
-Whenever a user command wants a job ID, it accepts any substring, as long as
-it is unique.
+Whenever a user command wants a job ID, it accepts any substring starting
+at a component boundary (start of the ID or a "-"), as long as the substring
+is unique.
### Status files ###
return @jobs;
}
+sub match_job_id($$) {
+ my ($id, $pattern) = @_;
+ return $id =~ m{\b$pattern};
+}
+
# Resolve a (possibly partial) job ID given by the user
sub resolve_job_id($$) {
my ($queue, $name) = @_;
return $name;
}
- my @candidates = map { index($_, $name) >= 0 ? $_ : () } $queue->all_job_ids();
+ my @candidates = grep { match_job_id($_, $name) } $queue->all_job_ids();
@candidates or die "No job called $name exists\n";
@candidates == 1 or die "Partial job ID $name is not unique\n";
return $candidates[0];