MCPcopy Create free account
hub / github.com/Driver-C/tryssh / ListAlias

Method ListAlias

pkg/control/alias.go:51–69  ·  view source on GitHub ↗

ListAlias prints all configured aliases, or only those matching the configured alias filter.

()

Source from the content-addressed store, hash-verified

49
50// ListAlias prints all configured aliases, or only those matching the configured alias filter.
51func (ac *AliasController) ListAlias() {
52 var aliasCount int
53 for _, server := range ac.configuration.ServerLists {
54 if ac.alias == "" {
55 if server.Alias != "" {
56 fmt.Printf("Alias: %s\tServer: %s\n", server.Alias, server.IP)
57 aliasCount++
58 }
59 } else {
60 if server.Alias == ac.alias {
61 fmt.Printf("Alias: %s\tServer: %s\n", server.Alias, server.IP)
62 aliasCount++
63 }
64 }
65 }
66 if aliasCount == 0 {
67 utils.Infoln("No aliases were found that have been set.")
68 }
69}
70
71// UnsetAlias removes the configured alias from all matching server entries.
72func (ac *AliasController) UnsetAlias() bool {

Calls 1

InfolnFunction · 0.92