(deps commandDeps)
| 426 | } |
| 427 | |
| 428 | func newConfigSetCommand(deps commandDeps) *cobra.Command { |
| 429 | var ( |
| 430 | scopeRaw string |
| 431 | workspaceRoot string |
| 432 | ) |
| 433 | cmd := &cobra.Command{ |
| 434 | Use: "set <path> <value>", |
| 435 | Short: "Set one config value through the validated config writer", |
| 436 | Args: cobra.ExactArgs(2), |
| 437 | RunE: func(cmd *cobra.Command, args []string) error { |
| 438 | return runConfigSetCommand(cmd, deps, scopeRaw, workspaceRoot, args) |
| 439 | }, |
| 440 | } |
| 441 | cmd.Flags(). |
| 442 | StringVar(&scopeRaw, configScopeKey, string(aghconfig.WriteScopeGlobal), "Write scope: global or workspace") |
| 443 | cmd.Flags().StringVar(&workspaceRoot, "workspace", "", "Workspace root for workspace-scoped writes") |
| 444 | return cmd |
| 445 | } |
| 446 | |
| 447 | func runConfigSetCommand( |
| 448 | cmd *cobra.Command, |
no test coverage detected