urfave / cli

A simple, fast, and fun package for building command line apps in Go
https://cli.urfave.org
MIT License
22.22k stars 1.7k forks source link

Make v3 examples runnable on pkg.go.dev #1812

Closed matthewdale closed 1 year ago

matthewdale commented 1 year ago

What type of PR is this?

What this PR does / why we need it:

Makes the examples rendered on pkg.go.dev runnable for v3.

Which issue(s) this PR fixes:

Fixes https://github.com/urfave/cli/issues/1811.

Testing

  1. Install pkgsite.
    go install golang.org/x/pkgsite/cmd/pkgsite@latest
  2. Browse to the cli repository root.
  3. Run pkgsite
    pkgsite
  4. Browse to http://localhost:8080/github.com/urfave/cli/v3#example-Command.Run-NoAction

The existing examples have no main function and are not runnable:

Screenshot 2023-09-02 at 2 57 17 PM

The fixed examples have a main and a "Run" button:

Screenshot 2023-09-02 at 2 56 48 PM

Release Notes

Make v3 examples runnable on pkg.go.dev.
github-actions[bot] commented 1 year ago
[![](https://raw.githubusercontent.com/jfrog/frogbot/master/resources/v2/noVulnerabilityBannerPR.png)](https://github.com/jfrog/frogbot#readme)
**Frogbot** also supports **Contextual Analysis, Secret Detection and IaC Vulnerabilities Scanning**. This features are included as part of the [JFrog Advanced Security](https://jfrog.com/xray/) package, which isn't enabled on your system.

[🐸 JFrog Frogbot](https://github.com/jfrog/frogbot#readme)