MCPcopy Create free account
hub / github.com/Mister-leo/fssh / generateAlias

Function generateAlias

cmd/fssh/setup_keys.go:279–292  ·  view source on GitHub ↗

generateAlias generates a suggested alias from the filename

(filename string)

Source from the content-addressed store, hash-verified

277
278// generateAlias generates a suggested alias from the filename
279func generateAlias(filename string) string {
280 // Remove "id_" prefix if present
281 alias := strings.TrimPrefix(filename, "id_")
282
283 // Remove common suffixes
284 alias = strings.TrimSuffix(alias, "_sk")
285
286 // If empty after trimming, use original filename
287 if alias == "" {
288 alias = filename
289 }
290
291 return alias
292}
293
294// parseSelection parses user selection string into indices
295// Supports formats: "all", "1", "1,3", "1-3", "1,3-5,7"

Callers 1

importSSHKeysFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected