M README.md => README.md +6 -0
@@ 8,4 8,10 @@ A terminal with snowflakes
git clone https://git.sr.ht/~rockorager/snowflake-term
cd snowflake-term
go run ./
+
```
+
+## Options
+
+`-n` int number of snowflakes
+`-speed` int speed of the snowflakes
M main.go => main.go +5 -0
@@ 2,6 2,7 @@ package main
import (
"flag"
+ "fmt"
"math/rand"
"os"
"os/exec"
@@ 20,6 21,10 @@ func main() {
flag.IntVar(&speed, "speed", 100, "speed of the flakes")
flag.Parse()
+ if speed <= 0 {
+ fmt.Println("speed must be > 0")
+ os.Exit(1)
+ }
vx, err := vaxis.New(vaxis.Options{})
if err != nil {
panic(err)