feat: add netssh link and shell aliases for links
netssh link add|list|remove manages links; netssh NAME follows them, links complete with Tab and get a shell alias. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
793f095e80
commit
e905a39068
5 files changed
+247
-1
No files matched your search
@@ -136,6 +136,12 @@ func completeHosts(toComplete string) []string {
|
||||
c := newCache(cfg)
|
||||
_ = c.Load()
|
||||
hosts := hostCompletions(c.All(), toComplete, cfg.Shortcuts)
|
||||
for name := range cfg.Links {
|
||||
if strings.HasPrefix(strings.ToLower(name), strings.ToLower(toComplete)) {
|
||||
hosts = append(hosts, strings.ToLower(name))
|
||||
}
|
||||
}
|
||||
sort.Strings(hosts)
|
||||
if limit := cfg.Completion.MaxResults; limit > 0 && len(hosts) > limit {
|
||||
hosts = hosts[:limit]
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user