MCPcopy Index your code
hub / github.com/docker/docker-agent / displayRef

Function displayRef

cmd/root/agent_picker.go:785–790  ·  view source on GitHub ↗

displayRef returns the ref as shown to the user: local config paths are shortened with "~", everything else is unchanged.

(ref string)

Source from the content-addressed store, hash-verified

783// displayRef returns the ref as shown to the user: local config paths are
784// shortened with "~", everything else is unchanged.
785func displayRef(ref string) string {
786 if isLocalConfigRef(ref) {
787 return path.ShortenHome(ref)
788 }
789 return ref
790}
791
792func (m *agentPickerModel) renderCard(choice agentChoice, cardWidth int, selected bool) string {
793 marker := " "

Callers 2

renderDetailsMethod · 0.85
renderCardMethod · 0.85

Calls 2

ShortenHomeFunction · 0.92
isLocalConfigRefFunction · 0.85

Tested by

no test coverage detected