func NewPartialFromPath(value string) (*PathExp, *int, error) {
	segments := strings.Split(value, "/")
	segments = segments[1:]
	if segments[len(segments)-1] == "" {
		segments = segments[:len(segments)-1]
	}

	org := stringAtIndex(segments, 0)
	project := stringAtIndex(segments, 1)

	envs, err := splitSliceAtIndex("environment", segments, 2)
	if err != nil {
		return nil, nil, errs.NewExitError(err.Error())
	}
	services, err := splitSliceAtIndex("service", segments, 3)
	if err != nil {
		return nil, nil, errs.NewExitError(err.Error())
	}
	users, err := splitSliceAtIndex("user", segments, 4)
	if err != nil {
		return nil, nil, errs.NewExitError(err.Error())
	}
	instances, err := splitSliceAtIndex("instance", segments, 5)
	if err != nil {
		return nil, nil, errs.NewExitError(err.Error())
	}

	return NewPartial(org, project, envs, services, users, instances)
}
// NewPartialFromPath creates a PathExp object from a cpath string that may be
// an incomplete path, resulting in added asterisks
NewPartialFromPath creates a PathExp object from a cpath string that may be
an incomplete path, resulting in added asterisks
// NewPartialFromPath creates a PathExp object from a cpath string that may be // an incomplete path resulting in added asterisks
func NewPartialFromPath(value string) (*PathExp, *int, error) {
	segments := strings.Split(value, "/")
	segments = segments[1:]
	if segments[len(segments)-1] == "" {
		segments = segments[:len(segments)-1]
	}
	org := stringAtIndex(segments, 0)
	project := stringAtIndex(segments, 1)
	envs, err := splitSliceAtIndex("environment", segments, 2)
	if err != nil {
		return nil, nil, errs.NewExitError(err.Error())
	}
	services, err := splitSliceAtIndex("service", segments, 3)
	if err != nil {
		return nil, nil, errs.NewExitError(err.Error())
	}
	users, err := splitSliceAtIndex("user", segments, 4)
	if err != nil {
		return nil, nil, errs.NewExitError(err.Error())
	}
	instances, err := splitSliceAtIndex("instance", segments, 5)
	if err != nil {
		return nil, nil, errs.NewExitError(err.Error())
	}
	return NewPartial(org, project, envs, services, users, instances)
}
func NewPartialFromPath ( value string ) ( * PathExp , * int , error ) { segments := strings . Split ( value , " " ) segments = segments [ 1 : ] if segments [ len ( segments ) - 1 ] == " " { segments = segments [ : len ( segments ) - 1 ] } org := stringAtIndex ( segments , 0 ) project := stringAtIndex ( segments , 1 ) envs , err := splitSliceAtIndex ( " " , segments , 2 ) if err != nil { return nil , nil , errs . NewExitError ( err . Error ( ) ) } services , err := splitSliceAtIndex ( " " , segments , 3 ) if err != nil { return nil , nil , errs . NewExitError ( err . Error ( ) ) } users , err := splitSliceAtIndex ( " " , segments , 4 ) if err != nil { return nil , nil , errs . NewExitError ( err . Error ( ) ) } instances , err := splitSliceAtIndex ( " " , segments , 5 ) if err != nil { return nil , nil , errs . NewExitError ( err . Error ( ) ) } return NewPartial ( org , project , envs , services , users , instances ) }
NewPartialFromPath creates a PathExp object from a cpath string that may be
an incomplete path, resulting in added asterisks
NewPartialFromPath creates a PathExp object from a cpath string that may be an incomplete path resulting in added asterisks