package segments

type Cf struct {
	Language
}

func (c *Cf) Template() string {
	return languageTemplate
}

func (c *Cf) Enabled() bool {
	c.extensions = []string{"manifest.yml", "mta.yaml"}
	c.tooling = map[string]*cmd{
		"cf": {
			executable: "cf",
			args:       []string{versionArg},
			regex:      versionRegexPrefixed,
		},
	}
	c.defaultTooling = []string{"cf"}
	c.displayMode = c.options.String(DisplayMode, DisplayModeFiles)
	c.versionURLTemplate = "https://github.com/cloudfoundry/cli/releases/tag/v{{ .Full }}"

	return c.Language.Enabled()
}
