(deps commandDeps)
| 352 | } |
| 353 | |
| 354 | func newConfigShowCommand(deps commandDeps) *cobra.Command { |
| 355 | var workspaceRoot string |
| 356 | cmd := &cobra.Command{ |
| 357 | Use: configShowKey, |
| 358 | Short: "Show the redacted effective config", |
| 359 | Args: cobra.NoArgs, |
| 360 | RunE: func(cmd *cobra.Command, _ []string) error { |
| 361 | cfg, resolvedWorkspace, err := loadConfigForDisplay(deps, workspaceRoot) |
| 362 | if err != nil { |
| 363 | return err |
| 364 | } |
| 365 | configMap := redactedConfigMap(&cfg) |
| 366 | entries := flattenConfigEntries(configMap) |
| 367 | record := configShowRecord{ |
| 368 | Scope: scopeForWorkspace(resolvedWorkspace), |
| 369 | WorkspaceRoot: resolvedWorkspace, |
| 370 | Redacted: true, |
| 371 | Config: configMap, |
| 372 | } |
| 373 | return writeCommandOutput(cmd, configShowBundle(record, entries)) |
| 374 | }, |
| 375 | } |
| 376 | cmd.Flags().StringVar(&workspaceRoot, "workspace", "", "Workspace root whose overlay should be included") |
| 377 | return cmd |
| 378 | } |
| 379 | |
| 380 | func newConfigListCommand(deps commandDeps) *cobra.Command { |
| 381 | var workspaceRoot string |
no test coverage detected