From af9b4ae832232391caff821ae13be9e54d9fcbab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ask=20Bj=C3=B8rn=20Hansen?= Date: Fri, 3 Apr 2026 18:27:00 -0700 Subject: [PATCH] Rename catalog-zone-gen to catz across codebase Update binary name, usage strings, generated file headers, tests, and README. The generated BIND config header now includes the install path: go install go.askask.com/catz@latest --- .gitignore | 2 +- README.md | 10 +++++----- bindconf.go | 2 +- bindconf_test.go | 4 ++-- catz.yaml.example | 2 +- main.go | 2 +- main_test.go | 16 ++++++++-------- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 105d781..256cd58 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ *~ -/catalog-zone-gen +/catz diff --git a/README.md b/README.md index 8a0ffcd..b890aa7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# catalog-zone-gen +# catz Generate RFC 9432 DNS catalog zone files from a declarative input file. @@ -10,19 +10,19 @@ serial bump, no file write). ## Installation ``` -go install catalog-zone-gen@latest +go install go.askask.com/catz@latest ``` Or build from source: ``` -go build -o catalog-zone-gen . +go build -o catz . ``` ## Usage ``` -catalog-zone-gen [--config path] [--output-dir path] [--bind-conf path] +catz [--config path] [--output-dir path] [--bind-conf path] ``` **Flags:** @@ -180,7 +180,7 @@ master` with their `file` paths from the `file=` input property. **Example output:** ``` -# THIS FILE IS GENERATED BY catalog-zone-gen +# THIS FILE IS GENERATED BY catz (go install go.askask.com/catz@latest) #============================================= # zone "askask.com" { diff --git a/bindconf.go b/bindconf.go index 4f4a0fd..568672c 100644 --- a/bindconf.go +++ b/bindconf.go @@ -19,7 +19,7 @@ func generateBindConf(entries []ZoneEntry, cfg *Config) string { }) var b strings.Builder - b.WriteString("# THIS FILE IS GENERATED BY catalog-zone-gen\n") + b.WriteString("# THIS FILE IS GENERATED BY catz (go install go.askask.com/catz@latest)\n") b.WriteString("#=============================================\n") b.WriteString("#\n") diff --git a/bindconf_test.go b/bindconf_test.go index d432b57..6573146 100644 --- a/bindconf_test.go +++ b/bindconf_test.go @@ -18,7 +18,7 @@ func TestGenerateBindConf(t *testing.T) { got := generateBindConf(entries, emptyCfg) // Header - assertContains(t, got, "# THIS FILE IS GENERATED BY catalog-zone-gen") + assertContains(t, got, "# THIS FILE IS GENERATED BY catz (go install go.askask.com/catz@latest)") assertContains(t, got, "#=============================================") // Zones should be sorted alphabetically (askask.com before bitcard.org) @@ -145,7 +145,7 @@ func TestWriteBindConfSkipsCatalogOnlyZones(t *testing.T) { got := string(data) // Should have header but no zone blocks - assertContains(t, got, "# THIS FILE IS GENERATED BY catalog-zone-gen") + assertContains(t, got, "# THIS FILE IS GENERATED BY catz (go install go.askask.com/catz@latest)") if strings.Contains(got, "example.com") { t.Error("zone without file= should not appear in BIND config") } diff --git a/catz.yaml.example b/catz.yaml.example index f0f5fdf..aeef4d9 100644 --- a/catz.yaml.example +++ b/catz.yaml.example @@ -1,4 +1,4 @@ -# catalog-zone-gen configuration +# catz configuration # # Each catalog becomes an output zone file named .zone # Catalog names here are referenced in zones.txt diff --git a/main.go b/main.go index 9367641..1e87993 100644 --- a/main.go +++ b/main.go @@ -14,7 +14,7 @@ func main() { outputDir := flag.String("output-dir", "", "directory for output zone files (default: same as input file)") bindConf := flag.String("bind-conf", "", "path to write BIND domains.conf") flag.Usage = func() { - fmt.Fprintf(os.Stderr, "Usage: catalog-zone-gen [--config path] [--output-dir path] [--bind-conf path] \n") + fmt.Fprintf(os.Stderr, "Usage: catz [--config path] [--output-dir path] [--bind-conf path] \n") flag.PrintDefaults() } flag.Parse() diff --git a/main_test.go b/main_test.go index eac0a1a..80821b2 100644 --- a/main_test.go +++ b/main_test.go @@ -229,7 +229,7 @@ soa: func TestIntegrationCLI(t *testing.T) { // Build the binary - binary := filepath.Join(t.TempDir(), "catalog-zone-gen") + binary := filepath.Join(t.TempDir(), "catz") cmd := exec.Command("go", "build", "-o", binary, ".") cmd.Dir = projectDir(t) if out, err := cmd.CombinedOutput(); err != nil { @@ -255,7 +255,7 @@ soa: cmd = exec.Command(binary, "--config", filepath.Join(dir, "catz.yaml"), "--output-dir", dir, filepath.Join(dir, "zones.txt")) out, err := cmd.CombinedOutput() if err != nil { - t.Fatalf("catalog-zone-gen failed: %v\n%s", err, out) + t.Fatalf("catz failed: %v\n%s", err, out) } // Verify output file exists @@ -270,7 +270,7 @@ soa: } func TestIntegrationCLIErrors(t *testing.T) { - binary := filepath.Join(t.TempDir(), "catalog-zone-gen") + binary := filepath.Join(t.TempDir(), "catz") cmd := exec.Command("go", "build", "-o", binary, ".") cmd.Dir = projectDir(t) if out, err := cmd.CombinedOutput(); err != nil { @@ -422,7 +422,7 @@ soa: } func TestIntegrationCLIBindConf(t *testing.T) { - binary := filepath.Join(t.TempDir(), "catalog-zone-gen") + binary := filepath.Join(t.TempDir(), "catz") cmd := exec.Command("go", "build", "-o", binary, ".") cmd.Dir = projectDir(t) if out, err := cmd.CombinedOutput(); err != nil { @@ -455,12 +455,12 @@ zone.example.com catalog1, file=data/zones/example.com filepath.Join(dir, "zones.txt")) out, err := cmd.CombinedOutput() if err != nil { - t.Fatalf("catalog-zone-gen failed: %v\n%s", err, out) + t.Fatalf("catz failed: %v\n%s", err, out) } // Verify bind conf was written content := readTestFile(t, bindConfPath) - assertContains(t, content, "# THIS FILE IS GENERATED BY catalog-zone-gen") + assertContains(t, content, "# THIS FILE IS GENERATED BY catz") // zone.example.com should come before zone.example.org (sorted) comIdx := strings.Index(content, "zone.example.com") @@ -483,7 +483,7 @@ zone.example.com catalog1, file=data/zones/example.com } func TestIntegrationCLIBindConfCatalogOnlyZone(t *testing.T) { - binary := filepath.Join(t.TempDir(), "catalog-zone-gen") + binary := filepath.Join(t.TempDir(), "catz") cmd := exec.Command("go", "build", "-o", binary, ".") cmd.Dir = projectDir(t) if out, err := cmd.CombinedOutput(); err != nil { @@ -524,7 +524,7 @@ soa: t.Fatalf("failed to read domains.conf: %v", readErr) } got := string(data) - assertContains(t, got, "# THIS FILE IS GENERATED BY catalog-zone-gen") + assertContains(t, got, "# THIS FILE IS GENERATED BY catz") if strings.Contains(got, "zone.example.org") { t.Error("catalog-only zone without file= should not appear in domains.conf") }