2018-11-19 21:36:21 +00:00
|
|
|
package remote
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"git.cryptic.systems/fh-trier/go-flucky/pkg/remote"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
2018-11-28 17:11:15 +00:00
|
|
|
var quiet bool
|
|
|
|
|
2018-11-19 21:36:21 +00:00
|
|
|
var listRemoteCmd = &cobra.Command{
|
|
|
|
Use: "list",
|
2018-11-21 19:48:10 +00:00
|
|
|
Short: "List Remove Servers",
|
2018-11-19 21:36:21 +00:00
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
|
2018-11-28 17:11:15 +00:00
|
|
|
if err := remote.Print(os.Stdout, configDir, quiet); err != nil {
|
2018-11-19 21:36:21 +00:00
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
remoteCmd.AddCommand(listRemoteCmd)
|
2018-11-28 17:11:15 +00:00
|
|
|
|
|
|
|
listRemoteCmd.Flags().BoolVarP(&quiet, "quiet", "q", false, "List only sensor id's")
|
2018-11-19 21:36:21 +00:00
|
|
|
}
|