output to file by default
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
@@ -88,12 +89,13 @@ func filejson[T any](path string) ([]T, error) {
|
||||
}
|
||||
|
||||
func main() {
|
||||
ts := time.Now().UTC().Format(time.DateOnly) // can't use RFC3339 because :s in filename
|
||||
var (
|
||||
dumpDir string
|
||||
out string
|
||||
)
|
||||
flag.StringVar(&dumpDir, "dump", ".", "`dir`ectory containing umadump output files")
|
||||
flag.StringVar(&out, "o", "", "output `file` (default stdout)")
|
||||
flag.StringVar(&out, "o", fmt.Sprintf("uma-col-all-%s.json", ts), "output `file` (stdout if empty)")
|
||||
flag.Parse()
|
||||
|
||||
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
|
||||
@@ -142,7 +144,7 @@ func main() {
|
||||
Game: "umamusume",
|
||||
Type: "collection",
|
||||
Version: 4,
|
||||
Timestamp: time.Now().String(),
|
||||
Timestamp: ts,
|
||||
Servers: map[string]CollectionServer{
|
||||
"en": {
|
||||
CharCards: charaLevels,
|
||||
|
||||
Reference in New Issue
Block a user