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

2
.gitignore vendored
View File

@@ -1,2 +1,2 @@
*~ *~
/catalog-zone-gen /catz

View File

@@ -1,4 +1,4 @@
# catalog-zone-gen # catz
Generate RFC 9432 DNS catalog zone files from a declarative input file. Generate RFC 9432 DNS catalog zone files from a declarative input file.
@@ -10,19 +10,19 @@ serial bump, no file write).
## Installation ## Installation
``` ```
go install catalog-zone-gen@latest go install go.askask.com/catz@latest
``` ```
Or build from source: Or build from source:
``` ```
go build -o catalog-zone-gen . go build -o catz .
``` ```
## Usage ## Usage
``` ```
catalog-zone-gen [--config path] [--output-dir path] [--bind-conf path] <input-file> catz [--config path] [--output-dir path] [--bind-conf path] <input-file>
``` ```
**Flags:** **Flags:**
@@ -180,7 +180,7 @@ master` with their `file` paths from the `file=` input property.
**Example output:** **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" { zone "askask.com" {

View File

@@ -19,7 +19,7 @@ func generateBindConf(entries []ZoneEntry, cfg *Config) string {
}) })
var b strings.Builder 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")
b.WriteString("#\n") b.WriteString("#\n")

View File

@@ -18,7 +18,7 @@ func TestGenerateBindConf(t *testing.T) {
got := generateBindConf(entries, emptyCfg) got := generateBindConf(entries, emptyCfg)
// Header // 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, "#=============================================") assertContains(t, got, "#=============================================")
// Zones should be sorted alphabetically (askask.com before bitcard.org) // Zones should be sorted alphabetically (askask.com before bitcard.org)
@@ -145,7 +145,7 @@ func TestWriteBindConfSkipsCatalogOnlyZones(t *testing.T) {
got := string(data) got := string(data)
// Should have header but no zone blocks // 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") { if strings.Contains(got, "example.com") {
t.Error("zone without file= should not appear in BIND config") t.Error("zone without file= should not appear in BIND config")
} }

View File

@@ -1,4 +1,4 @@
# catalog-zone-gen configuration # catz configuration
# #
# Each catalog becomes an output zone file named <zone>.zone # Each catalog becomes an output zone file named <zone>.zone
# Catalog names here are referenced in zones.txt # Catalog names here are referenced in zones.txt

View File

@@ -14,7 +14,7 @@ func main() {
outputDir := flag.String("output-dir", "", "directory for output zone files (default: same as input file)") 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") bindConf := flag.String("bind-conf", "", "path to write BIND domains.conf")
flag.Usage = func() { flag.Usage = func() {
fmt.Fprintf(os.Stderr, "Usage: catalog-zone-gen [--config path] [--output-dir path] [--bind-conf path] <input-file>\n") fmt.Fprintf(os.Stderr, "Usage: catz [--config path] [--output-dir path] [--bind-conf path] <input-file>\n")
flag.PrintDefaults() flag.PrintDefaults()
} }
flag.Parse() flag.Parse()

View File

@@ -229,7 +229,7 @@ soa:
func TestIntegrationCLI(t *testing.T) { func TestIntegrationCLI(t *testing.T) {
// Build the binary // 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 := exec.Command("go", "build", "-o", binary, ".")
cmd.Dir = projectDir(t) cmd.Dir = projectDir(t)
if out, err := cmd.CombinedOutput(); err != nil { 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")) cmd = exec.Command(binary, "--config", filepath.Join(dir, "catz.yaml"), "--output-dir", dir, filepath.Join(dir, "zones.txt"))
out, err := cmd.CombinedOutput() out, err := cmd.CombinedOutput()
if err != nil { 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 // Verify output file exists
@@ -270,7 +270,7 @@ soa:
} }
func TestIntegrationCLIErrors(t *testing.T) { 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 := exec.Command("go", "build", "-o", binary, ".")
cmd.Dir = projectDir(t) cmd.Dir = projectDir(t)
if out, err := cmd.CombinedOutput(); err != nil { if out, err := cmd.CombinedOutput(); err != nil {
@@ -422,7 +422,7 @@ soa:
} }
func TestIntegrationCLIBindConf(t *testing.T) { 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 := exec.Command("go", "build", "-o", binary, ".")
cmd.Dir = projectDir(t) cmd.Dir = projectDir(t)
if out, err := cmd.CombinedOutput(); err != nil { 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")) filepath.Join(dir, "zones.txt"))
out, err := cmd.CombinedOutput() out, err := cmd.CombinedOutput()
if err != nil { 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 // Verify bind conf was written
content := readTestFile(t, bindConfPath) 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) // zone.example.com should come before zone.example.org (sorted)
comIdx := strings.Index(content, "zone.example.com") 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) { 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 := exec.Command("go", "build", "-o", binary, ".")
cmd.Dir = projectDir(t) cmd.Dir = projectDir(t)
if out, err := cmd.CombinedOutput(); err != nil { if out, err := cmd.CombinedOutput(); err != nil {
@@ -524,7 +524,7 @@ soa:
t.Fatalf("failed to read domains.conf: %v", readErr) t.Fatalf("failed to read domains.conf: %v", readErr)
} }
got := string(data) 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") { if strings.Contains(got, "zone.example.org") {
t.Error("catalog-only zone without file= should not appear in domains.conf") t.Error("catalog-only zone without file= should not appear in domains.conf")
} }