Markus Pesch
500d1a5823
Changes: - Split temperatures from log file into blocks. Every block has a size of 500 entries. Every block would be send to the remote host
35 lines
661 B
Go
35 lines
661 B
Go
package remote
|
|
|
|
import (
|
|
"log"
|
|
|
|
"git.cryptic.systems/fh-trier/go-flucky/pkg/remote"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var all bool
|
|
|
|
var rmRemoteCmd = &cobra.Command{
|
|
Use: "rm",
|
|
Short: "Remove Remote Server",
|
|
Aliases: []string{"remove"},
|
|
Args: cobra.RangeArgs(0, 1),
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
if all {
|
|
if err := remote.RemoveAll(configDir); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
} else {
|
|
if err := remote.Remove(args[0], configDir); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
remoteCmd.AddCommand(rmRemoteCmd)
|
|
rmRemoteCmd.Flags().BoolVarP(&all, "all", "a", false, "Select all remote connections")
|
|
}
|