mirror of
https://github.com/Gu1llaum-3/sshm.git
synced 2025-09-04 09:46:32 +02:00
28 lines
518 B
Go
28 lines
518 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"sshm/internal/ui"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var editCmd = &cobra.Command{
|
|
Use: "edit <hostname>",
|
|
Short: "Edit an existing SSH host configuration",
|
|
Long: `Edit an existing SSH host configuration with an interactive form.`,
|
|
Args: cobra.ExactArgs(1),
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
hostname := args[0]
|
|
|
|
err := ui.RunEditForm(hostname)
|
|
if err != nil {
|
|
fmt.Printf("Error editing host: %v\n", err)
|
|
}
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(editCmd)
|
|
}
|