commit 6c17cc3

chld  ·  2026-02-06 04:17:30 +0000 UTC
parent bce4b16
handle no args
1 files changed,  +13, -0
+13, -0
 1@@ -4,9 +4,22 @@ import (
 2 	"fmt"
 3 	"git.sr.ht/~chld/dgr/cmd"
 4 	"os"
 5+	"path/filepath"
 6 )
 7 
 8+func help() {
 9+	fmt.Printf("%s ", filepath.Base(os.Args[0]))
10+	fmt.Printf("[sp]")
11+
12+	fmt.Println()
13+}
14+
15 func main() {
16+	if len(os.Args) <= 2 {
17+		help()
18+		return
19+	}
20+
21 	switch os.Args[1] {
22 	case "sp":
23