Split all cmd/* packages for maintainability, following the pattern established in cmd/php. Each package now has: - Main file with styles (using cmd/shared) and Add*Commands function - Separate files for logical command groupings Packages refactored: - cmd/dev: 13 files (was 2779 lines in one file) - cmd/build: 5 files (was 913 lines) - cmd/setup: 6 files (was 961 lines) - cmd/go: 5 files (was 655 lines) - cmd/pkg: 5 files (was 634 lines) - cmd/vm: 4 files (was 717 lines) - cmd/ai: 5 files (was 800 lines) - cmd/docs: 5 files (was 379 lines) - cmd/doctor: 5 files (was 301 lines) - cmd/test: 3 files (was 429 lines) - cmd/ci: 5 files (was 272 lines) All packages now import shared styles from cmd/shared instead of redefining them locally. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
38 lines
1.1 KiB
Go
38 lines
1.1 KiB
Go
// Package gocmd provides Go development commands.
|
|
//
|
|
// Note: Package named gocmd because 'go' is a reserved keyword.
|
|
package gocmd
|
|
|
|
import (
|
|
"github.com/host-uk/core/cmd/shared"
|
|
"github.com/leaanthony/clir"
|
|
)
|
|
|
|
// Style aliases for shared styles
|
|
var (
|
|
successStyle = shared.SuccessStyle
|
|
errorStyle = shared.ErrorStyle
|
|
dimStyle = shared.DimStyle
|
|
)
|
|
|
|
// AddGoCommands adds Go development commands.
|
|
func AddGoCommands(parent *clir.Cli) {
|
|
goCmd := parent.NewSubCommand("go", "Go development tools")
|
|
goCmd.LongDescription("Go development tools with enhanced output and environment setup.\n\n" +
|
|
"Commands:\n" +
|
|
" test Run tests\n" +
|
|
" cov Run tests with coverage report\n" +
|
|
" fmt Format Go code\n" +
|
|
" lint Run golangci-lint\n" +
|
|
" install Install Go binary\n" +
|
|
" mod Module management (tidy, download, verify)\n" +
|
|
" work Workspace management")
|
|
|
|
addGoTestCommand(goCmd)
|
|
addGoCovCommand(goCmd)
|
|
addGoFmtCommand(goCmd)
|
|
addGoLintCommand(goCmd)
|
|
addGoInstallCommand(goCmd)
|
|
addGoModCommand(goCmd)
|
|
addGoWorkCommand(goCmd)
|
|
}
|