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
This commit is contained in:
2026-04-03 18:27:00 -07:00
parent f21d9c8ff5
commit af9b4ae832
7 changed files with 19 additions and 19 deletions

View File

@@ -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")
}