@@ -75,6 +75,14 @@ func init() {
7575 rootCmd .AddCommand (listScopesCmd )
7676}
7777
78+ // formatScopeDisplay formats a scope string for display, handling empty scopes.
79+ func formatScopeDisplay (scope string ) string {
80+ if scope == "" {
81+ return "(no scope required for public read access)"
82+ }
83+ return scope
84+ }
85+
7886func runListScopes () error {
7987 // Get toolsets configuration (same logic as stdio command)
8088 var enabledToolsets []string
@@ -217,11 +225,7 @@ func outputSummary(output ScopesOutput) error {
217225 fmt .Println ("Required OAuth scopes for enabled tools:" )
218226 fmt .Println ()
219227 for _ , scope := range output .UniqueScopes {
220- if scope == "" {
221- fmt .Println (" (no scope required for public read access)" )
222- } else {
223- fmt .Printf (" %s\n " , scope )
224- }
228+ fmt .Printf (" %s\n " , formatScopeDisplay (scope ))
225229 }
226230 fmt .Printf ("\n Total: %d unique scope(s)\n " , len (output .UniqueScopes ))
227231 return nil
@@ -275,11 +279,7 @@ func outputText(output ScopesOutput) error {
275279 } else {
276280 fmt .Println ("Unique scopes required:" )
277281 for _ , scope := range output .UniqueScopes {
278- if scope == "" {
279- fmt .Println (" • (no scope - public read access)" )
280- } else {
281- fmt .Printf (" • %s\n " , scope )
282- }
282+ fmt .Printf (" • %s\n " , formatScopeDisplay (scope ))
283283 }
284284 }
285285 fmt .Printf ("\n Total: %d tools, %d unique scopes\n " , len (output .Tools ), len (output .UniqueScopes ))
0 commit comments