| 12345678910111213141516171819202122232425262728293031323334 |
- package main
- import (
- "os"
- )
- func initConfig() {
- config = Config{
- DryRun: false,
- Verbose: false,
- Interactive: false,
- LogsDir: "./logs",
- RunsDir: "./runs",
- }
- os.MkdirAll("logs", 0o755)
- }
- func main() {
- initConfig()
- runCmd.Flags().BoolVar(&config.DryRun, "dry", false, "Show what would run without executing")
- runCmd.Flags().BoolVarP(&config.Verbose, "verbose", "v", false, "Show script output in terminal")
- runCmd.Flags().BoolVarP(&config.Interactive, "interactive", "i", false, "Run script interactively (show output and allow input)")
- // This prevents Cobra from consuming -- and everything after it
- runCmd.Flags().SetInterspersed(false)
- rootCmd.AddCommand(runCmd, listCmd, newCmd, pushCmd, depsCmd, completionCmd)
- if err := rootCmd.Execute(); err != nil {
- os.Exit(1)
- }
- }
|