mirror of
https://github.com/Gu1llaum-3/sshm.git
synced 2026-01-27 03:04:21 +01:00
feat: focus on search input at startup (#27)
This commit is contained in:
@@ -24,6 +24,9 @@ var AppVersion = "dev"
|
||||
// configFile holds the path to the SSH config file
|
||||
var configFile string
|
||||
|
||||
// searchMode enables the focus on search mode at startup
|
||||
var searchMode bool
|
||||
|
||||
// RootCmd is the base command when called without any subcommands
|
||||
var RootCmd = &cobra.Command{
|
||||
Use: "sshm [host]",
|
||||
@@ -97,7 +100,7 @@ func runInteractiveMode() {
|
||||
}
|
||||
|
||||
// Run the interactive TUI
|
||||
if err := ui.RunInteractiveMode(hosts, configFile, AppVersion); err != nil {
|
||||
if err := ui.RunInteractiveMode(hosts, configFile, searchMode, AppVersion); err != nil {
|
||||
log.Fatalf("Error running interactive mode: %v", err)
|
||||
}
|
||||
}
|
||||
@@ -219,6 +222,7 @@ func Execute() {
|
||||
func init() {
|
||||
// Add the config file flag
|
||||
RootCmd.PersistentFlags().StringVarP(&configFile, "config", "c", "", "SSH config file to use (default: ~/.ssh/config)")
|
||||
RootCmd.PersistentFlags().BoolVarP(&searchMode, "search", "s", false, "Focus on search input at startup")
|
||||
|
||||
// Set custom version template with update check
|
||||
RootCmd.SetVersionTemplate(getVersionWithUpdateCheck())
|
||||
|
||||
Reference in New Issue
Block a user