Esempio n. 1
0
File: job_flag.go Progetto: mmb/fly
func (job *JobFlag) UnmarshalFlag(value string) error {
	vs := strings.SplitN(value, "/", 2)
	if vs[0] == "" {
		return concourse.NameRequiredError("pipeline")
	}
	if vs[1] == "" {
		return concourse.NameRequiredError("job")
	}

	job.PipelineName = vs[0]
	job.JobName = vs[1]

	return nil
}
Esempio n. 2
0
func (resource *ResourceFlag) UnmarshalFlag(value string) error {
	vs := strings.SplitN(value, "/", 2)
	if vs[0] == "" {
		return concourse.NameRequiredError("pipeline")
	}
	if vs[1] == "" {
		return concourse.NameRequiredError("resource")
	}

	resource.PipelineName = vs[0]
	resource.ResourceName = vs[1]

	return nil
}
Esempio n. 3
0
func (job *JobFlag) UnmarshalFlag(value string) error {
	vs := strings.SplitN(value, "/", 2)

	if len(vs) != 2 {
		return errors.New("argument format should be <pipeline>/<job>")
	}

	if vs[0] == "" {
		return concourse.NameRequiredError("pipeline")
	}

	if vs[1] == "" {
		return concourse.NameRequiredError("job")
	}

	job.PipelineName = vs[0]
	job.JobName = vs[1]

	return nil
}
Esempio n. 4
0
func (resource *ResourceFlag) UnmarshalFlag(value string) error {
	vs := strings.SplitN(value, "/", 2)

	if len(vs) != 2 {
		return errors.New("argument format should be <pipeline>/<resource>")
	}

	if vs[0] == "" {
		return concourse.NameRequiredError("pipeline")
	}

	if vs[1] == "" {
		return concourse.NameRequiredError("resource")
	}

	resource.PipelineName = vs[0]
	resource.ResourceName = vs[1]

	return nil
}