feat: support custom SSH config files via -c flag

This commit is contained in:
2025-09-02 17:00:17 +02:00
parent 98aa2b6579
commit 94225cbfbe
8 changed files with 613 additions and 49 deletions

View File

@@ -14,7 +14,7 @@ import (
)
// NewModel creates a new TUI model with the given SSH hosts
func NewModel(hosts []config.SSHHost) Model {
func NewModel(hosts []config.SSHHost, configFile string) Model {
// Initialize the history manager
historyManager, err := history.NewHistoryManager()
if err != nil {
@@ -31,6 +31,7 @@ func NewModel(hosts []config.SSHHost) Model {
hosts: hosts,
historyManager: historyManager,
sortMode: SortByName,
configFile: configFile,
styles: styles,
width: 80,
height: 24,
@@ -138,8 +139,8 @@ func NewModel(hosts []config.SSHHost) Model {
}
// RunInteractiveMode starts the interactive TUI interface
func RunInteractiveMode(hosts []config.SSHHost) error {
m := NewModel(hosts)
func RunInteractiveMode(hosts []config.SSHHost, configFile string) error {
m := NewModel(hosts, configFile)
// Start the application in alt screen mode for clean output
p := tea.NewProgram(m, tea.WithAltScreen())