-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
66 lines (57 loc) · 2.48 KB
/
main.go
File metadata and controls
66 lines (57 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Package main provides the entry point for the audit-cli tool.
//
// audit-cli is a command-line tool for performing audit-related tasks in the
// MongoDB documentation monorepo. It helps technical writers with maintenance
// tasks, scoping work, and reporting information to stakeholders.
//
// The CLI is organized into parent commands with subcommands:
// - extract: Extract content from RST files (code examples, procedures)
// - search: Search through documentation files
// - analyze: Analyze RST file structures and relationships
// - compare: Compare files across different versions
// - count: Count documentation content (code examples, pages)
// - resolve: Resolve paths and URLs between source files and production
package main
import (
"fmt"
"github.com/grove-platform/audit-cli/commands/analyze"
"github.com/grove-platform/audit-cli/commands/compare"
"github.com/grove-platform/audit-cli/commands/count"
"github.com/grove-platform/audit-cli/commands/extract"
"github.com/grove-platform/audit-cli/commands/report"
"github.com/grove-platform/audit-cli/commands/resolve"
"github.com/grove-platform/audit-cli/commands/search"
"github.com/spf13/cobra"
)
// version is the current version of audit-cli.
// Update this when releasing new versions following semantic versioning.
const version = "0.3.0"
func main() {
var rootCmd = &cobra.Command{
Use: "audit-cli",
Version: version,
Short: "A CLI tool for auditing and analyzing MongoDB documentation",
Long: `audit-cli helps MongoDB technical writers perform audit-related tasks in the
documentation monorepo, including:
- Extracting content (code examples, procedures) for testing and migration
- Searching documentation files for specific strings or patterns
- Analyzing file dependencies and relationships
- Comparing files across documentation versions
- Counting documentation content for reporting and metrics
Designed for maintenance tasks, scoping work, and reporting to stakeholders.`,
}
// Customize version output format
rootCmd.SetVersionTemplate(fmt.Sprintf("audit-cli version %s\n", version))
// Add parent commands
rootCmd.AddCommand(extract.NewExtractCommand())
rootCmd.AddCommand(search.NewSearchCommand())
rootCmd.AddCommand(analyze.NewAnalyzeCommand())
rootCmd.AddCommand(compare.NewCompareCommand())
rootCmd.AddCommand(count.NewCountCommand())
rootCmd.AddCommand(report.NewReportCommand())
rootCmd.AddCommand(resolve.NewResolveCommand())
err := rootCmd.Execute()
if err != nil {
return
}
}