Step 1: Replace C++ prototype with Go project scaffolding.
Remove all old C++ source files, proto definitions, CMake build, clang configs, IDE files, and Trunk linter config. Initialize Go module (github.com/kisom/sgard) with cobra and yaml.v3 deps. Set up cobra root command with --repo persistent flag. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
33
cmd/sgard/main.go
Normal file
33
cmd/sgard/main.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var repoFlag string
|
||||
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "sgard",
|
||||
Short: "Shimmering Clarity Gardener: dotfile management",
|
||||
}
|
||||
|
||||
func defaultRepo() string {
|
||||
home, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
return ".sgard"
|
||||
}
|
||||
return filepath.Join(home, ".sgard")
|
||||
}
|
||||
|
||||
func main() {
|
||||
rootCmd.PersistentFlags().StringVar(&repoFlag, "repo", defaultRepo(), "path to sgard repository")
|
||||
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user