mirror of
https://github.com/Gu1llaum-3/sshm.git
synced 2025-10-19 01:17:20 +02:00
Export rootCmd->RootCmd and appVersion->AppVersion to fix test compilation errors. Update all references across cmd package and tests.
29 lines
607 B
Go
29 lines
607 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/Gu1llaum-3/sshm/internal/ui"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var moveCmd = &cobra.Command{
|
|
Use: "move <hostname>",
|
|
Short: "Move an existing SSH host configuration to another config file",
|
|
Long: `Move an existing SSH host configuration to another config file with an interactive file selector.`,
|
|
Args: cobra.ExactArgs(1),
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
hostname := args[0]
|
|
|
|
err := ui.RunMoveForm(hostname, configFile)
|
|
if err != nil {
|
|
fmt.Printf("Error moving host: %v\n", err)
|
|
}
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
RootCmd.AddCommand(moveCmd)
|
|
}
|