Notify the user that is probably not what they intended to do.
"log"
"os"
+ "golang.org/x/term"
+
"ruderich.org/simon/safcm"
"ruderich.org/simon/safcm/cmd/safcm-remote/ainsl"
"ruderich.org/simon/safcm/cmd/safcm-remote/info"
}
func mainLoop() error {
+ if term.IsTerminal(int(os.Stdin.Fd())) ||
+ term.IsTerminal(int(os.Stdout.Fd())) {
+ return fmt.Errorf("sync should only be called from `safcm` " +
+ "(redirect stdin/stdout to circumvent this check)")
+ }
+
conn := safcm.NewGobConn(os.Stdin, os.Stdout)
var logLevel safcm.LogLevel