(deps commandDeps)
| 310 | } |
| 311 | |
| 312 | func newToolsetsInfoCommand(deps commandDeps) *cobra.Command { |
| 313 | var scope toolScopeFlags |
| 314 | cmd := &cobra.Command{ |
| 315 | Use: "info <toolset_id>", |
| 316 | Short: "Show one registry toolset expansion", |
| 317 | Example: ` # Show one toolset and expanded tool ids |
| 318 | agh toolsets info agh__catalog -o json`, |
| 319 | Args: exactOneNonBlankArg(), |
| 320 | RunE: func(cmd *cobra.Command, args []string) error { |
| 321 | id, err := parseToolsetIDArg(args[0]) |
| 322 | if err != nil { |
| 323 | return writeToolCommandError(cmd, err) |
| 324 | } |
| 325 | return runToolCommand(cmd, deps, func(client DaemonClient) error { |
| 326 | response, err := client.GetToolset(cmd.Context(), id.String(), scope.query()) |
| 327 | if err != nil { |
| 328 | return err |
| 329 | } |
| 330 | return writeCommandOutput(cmd, toolsetInfoBundle(response)) |
| 331 | }) |
| 332 | }, |
| 333 | } |
| 334 | scope.bind(cmd) |
| 335 | return cmd |
| 336 | } |
| 337 | |
| 338 | func (f *toolScopeFlags) bind(cmd *cobra.Command) { |
| 339 | cmd.Flags().StringVar(&f.workspaceID, "workspace", "", "Workspace id for scoped diagnostics") |
no test coverage detected