(f *cmdutil.Factory)
| 23 | } |
| 24 | |
| 25 | func NewCmdAccessibility(f *cmdutil.Factory) *cobra.Command { |
| 26 | opts := AccessibilityOptions{ |
| 27 | IO: f.IOStreams, |
| 28 | Browser: f.Browser, |
| 29 | } |
| 30 | |
| 31 | cmd := &cobra.Command{ |
| 32 | Use: "accessibility", |
| 33 | Aliases: []string{"a11y"}, |
| 34 | Short: "Learn about GitHub CLI's accessibility experiences", |
| 35 | Long: longDescription(opts.IO), |
| 36 | Hidden: true, |
| 37 | RunE: func(cmd *cobra.Command, args []string) error { |
| 38 | if opts.Web { |
| 39 | if opts.IO.IsStdoutTTY() { |
| 40 | fmt.Fprintf(opts.IO.ErrOut, "Opening %s in your browser.\n", text.DisplayURL(acrURL)) |
| 41 | } |
| 42 | return opts.Browser.Browse(acrURL) |
| 43 | } |
| 44 | |
| 45 | return cmd.Help() |
| 46 | }, |
| 47 | Example: heredoc.Doc(` |
| 48 | # Open the GitHub Accessibility site in your browser |
| 49 | $ gh accessibility --web |
| 50 | |
| 51 | # Display color using customizable, 4-bit accessible colors |
| 52 | $ gh config set accessible_colors enabled |
| 53 | |
| 54 | # Use input prompts without redrawing the screen |
| 55 | $ gh config set accessible_prompter enabled |
| 56 | |
| 57 | # Disable motion-based spinners for progress indicators in favor of text |
| 58 | $ gh config set spinner disabled |
| 59 | `), |
| 60 | } |
| 61 | |
| 62 | cmd.Flags().BoolVarP(&opts.Web, "web", "w", false, "Open the GitHub Accessibility site in your browser") |
| 63 | cmdutil.DisableAuthCheck(cmd) |
| 64 | |
| 65 | return cmd |
| 66 | } |
| 67 | |
| 68 | func longDescription(io *iostreams.IOStreams) string { |
| 69 | cs := io.ColorScheme() |
nothing calls this directly
no test coverage detected