(output ScopesOutput)
| 235 | } |
| 236 | |
| 237 | func outputText(output ScopesOutput) error { |
| 238 | fmt.Printf("OAuth Scopes for Enabled Tools\n") |
| 239 | fmt.Printf("==============================\n\n") |
| 240 | |
| 241 | fmt.Printf("Enabled Toolsets: %s\n", strings.Join(output.EnabledToolsets, ", ")) |
| 242 | fmt.Printf("Read-Only Mode: %v\n\n", output.ReadOnly) |
| 243 | |
| 244 | // Group tools by toolset |
| 245 | toolsByToolset := make(map[string][]ToolScopeInfo) |
| 246 | for _, tool := range output.Tools { |
| 247 | toolsByToolset[tool.Toolset] = append(toolsByToolset[tool.Toolset], tool) |
| 248 | } |
| 249 | |
| 250 | // Get sorted toolset names |
| 251 | var toolsetNames []string |
| 252 | for name := range toolsByToolset { |
| 253 | toolsetNames = append(toolsetNames, name) |
| 254 | } |
| 255 | sort.Strings(toolsetNames) |
| 256 | |
| 257 | for _, toolsetName := range toolsetNames { |
| 258 | tools := toolsByToolset[toolsetName] |
| 259 | fmt.Printf("## %s\n\n", formatToolsetName(toolsetName)) |
| 260 | |
| 261 | for _, tool := range tools { |
| 262 | rwIndicator := "📝" |
| 263 | if tool.ReadOnly { |
| 264 | rwIndicator = "👁" |
| 265 | } |
| 266 | |
| 267 | scopeStr := "(no scope required)" |
| 268 | if len(tool.RequiredScopes) > 0 { |
| 269 | scopeStr = strings.Join(tool.RequiredScopes, ", ") |
| 270 | } |
| 271 | |
| 272 | fmt.Printf(" %s %s: %s\n", rwIndicator, tool.Name, scopeStr) |
| 273 | } |
| 274 | fmt.Println() |
| 275 | } |
| 276 | |
| 277 | // Summary |
| 278 | fmt.Println("## Summary") |
| 279 | fmt.Println() |
| 280 | if len(output.UniqueScopes) == 0 { |
| 281 | fmt.Println("No OAuth scopes required for enabled tools.") |
| 282 | } else { |
| 283 | fmt.Println("Unique scopes required:") |
| 284 | for _, scope := range output.UniqueScopes { |
| 285 | fmt.Printf(" • %s\n", formatScopeDisplay(scope)) |
| 286 | } |
| 287 | } |
| 288 | fmt.Printf("\nTotal: %d tools, %d unique scopes\n", len(output.Tools), len(output.UniqueScopes)) |
| 289 | |
| 290 | // Legend |
| 291 | fmt.Println("\nLegend: 👁 = read-only, 📝 = read-write") |
| 292 | |
| 293 | return nil |
| 294 | } |
no test coverage detected