package remote import ( "log" "git.cryptic.systems/fh-trier/go-flucky/pkg/config" "github.com/spf13/cobra" ) var rmRemoteCmd = &cobra.Command{ Use: "rm", Short: "Remove Remote Server", Aliases: []string{"remove"}, Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { // read configuration fc, err := config.Read(cfg) if err != nil { log.Fatalln(err) } // add remote entry to list err = fc.RemoveRemote(args[0]) if err != nil { log.Fatalln(err) } // save new configuration err = config.Write(fc, cfg) if err != nil { log.Fatalln(err) } }, } func init() { remoteCmd.AddCommand(rmRemoteCmd) }