docs: clarify main usage in help text (TUI by default, CLI also available)

This commit is contained in:
Gu1llaum-3 2025-09-03 10:48:35 +02:00
parent 3a72694e5a
commit b5d8d505cf
2 changed files with 14 additions and 9 deletions

View File

@ -21,9 +21,14 @@ var configFile string
var rootCmd = &cobra.Command{ var rootCmd = &cobra.Command{
Use: "sshm", Use: "sshm",
Short: "SSH Manager - A modern SSH connection manager", Short: "SSH Manager - A modern SSH connection manager",
Long: `SSH Manager (sshm) is a modern command-line tool for managing SSH connections. Long: `SSHM is a modern SSH manager for your terminal.
It provides an interactive interface to browse and connect to your SSH hosts
configured in your ~/.ssh/config file.`, Main usage:
Running 'sshm' (without arguments) opens the interactive TUI window to browse, search, and connect to your SSH hosts graphically.
You can also use sshm in CLI mode for direct operations.
Hosts are read from your ~/.ssh/config file by default.`,
Version: version, Version: version,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
// If no arguments provided, run interactive mode // If no arguments provided, run interactive mode

View File

@ -70,14 +70,14 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, tea.Quit return m, tea.Quit
} }
m.hosts = m.sortHosts(hosts) m.hosts = m.sortHosts(hosts)
// Reapply search filter if there is one active // Reapply search filter if there is one active
if m.searchInput.Value() != "" { if m.searchInput.Value() != "" {
m.filteredHosts = m.filterHosts(m.searchInput.Value()) m.filteredHosts = m.filterHosts(m.searchInput.Value())
} else { } else {
m.filteredHosts = m.hosts m.filteredHosts = m.hosts
} }
m.updateTableRows() m.updateTableRows()
m.viewMode = ViewList m.viewMode = ViewList
m.addForm = nil m.addForm = nil
@ -114,14 +114,14 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, tea.Quit return m, tea.Quit
} }
m.hosts = m.sortHosts(hosts) m.hosts = m.sortHosts(hosts)
// Reapply search filter if there is one active // Reapply search filter if there is one active
if m.searchInput.Value() != "" { if m.searchInput.Value() != "" {
m.filteredHosts = m.filterHosts(m.searchInput.Value()) m.filteredHosts = m.filterHosts(m.searchInput.Value())
} else { } else {
m.filteredHosts = m.hosts m.filteredHosts = m.hosts
} }
m.updateTableRows() m.updateTableRows()
m.viewMode = ViewList m.viewMode = ViewList
m.editForm = nil m.editForm = nil
@ -248,14 +248,14 @@ func (m Model) handleListViewKeys(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
return m, nil return m, nil
} }
m.hosts = m.sortHosts(hosts) m.hosts = m.sortHosts(hosts)
// Reapply search filter if there is one active // Reapply search filter if there is one active
if m.searchInput.Value() != "" { if m.searchInput.Value() != "" {
m.filteredHosts = m.filterHosts(m.searchInput.Value()) m.filteredHosts = m.filterHosts(m.searchInput.Value())
} else { } else {
m.filteredHosts = m.hosts m.filteredHosts = m.hosts
} }
m.updateTableRows() m.updateTableRows()
m.deleteMode = false m.deleteMode = false
m.deleteHost = "" m.deleteHost = ""