INNER CODE UNIT · Go
formatCurrentVersionLine
asdf-vm/asdf · internal/cli/cli.go:479
func formatCurrentVersionLine(w *tabwriter.Writer, plugin plugins.Plugin, toolversion resolve.ToolVersions, found bool, installed bool, err error) error {
if err != nil {
return err
}
// columns are: name, version, source, installed
version := formatVersions(toolversion.Versions)
source := formatSource(toolversion, found)
installedStatus := formatInstalled(toolversion, plugin.Name, found, installed)
fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", plugin.Name, version, source, installedStatus)
return nil
}
func formatInstalled(toolversion resolve.ToolVersions, name string, found, installed bool) string {
if !found {
return ""
}
if !installed {