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>
34 lines
557 B
Go
34 lines
557 B
Go
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)
|
|
}
|
|
}
|