diff src/magicpacket.go @ 39:523416ca4b83

diet magicpacket.go
author pyon@macmini
date Tue, 04 Feb 2020 21:31:50 +0900
parents 90659c7171ed
children c6df3bae683e
line wrap: on
line diff
--- a/src/magicpacket.go	Sat Jan 11 17:00:30 2020 +0900
+++ b/src/magicpacket.go	Tue Feb 04 21:31:50 2020 +0900
@@ -10,14 +10,11 @@
 
 func main() {
 	if len(os.Args) < 2 {
-		fmt.Fprintln(os.Stderr, "wol mac-address1 mac-address2 ...")
+		fmt.Fprintln(os.Stderr, "magicpacket mac-address1 mac-address2 ...")
 		os.Exit(1)
 	}
-	for i, m := range os.Args {
-		if i == 0 {
-			continue
-		}
-		hw, err := net.ParseMAC(m)
+    for _, mac := range os.Args[1:] {
+		hw, err := net.ParseMAC(mac)
 		if err != nil {
 			log.Fatal(err)
 		}