Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Extended documentation library for use with urfave/cli/v3

License

NotificationsYou must be signed in to change notification settings

urfave/cli-docs

Repository files navigation

Run TestsGo ReferenceGo Report Card

urfave/cli-docs/v3 is an extended documentation library for use with urfave/cli/v3.

Start using

  1. Add the dependency to your project
 go get github.com/urfave/cli-docs/v3@latest
  1. Add it as import
 import (+  docs "github.com/urfave/cli-docs/v3" )
  1. Now use it e.g. to generate markdown document from a command
package mainimport ("context""fmt""os"    docs"github.com/urfave/cli-docs/v3"    cli"github.com/urfave/cli/v3")funcmain() {app:=&cli.Command{Name:"greet",Usage:"say a greeting",Action:func(ctx context.Context,c*cli.Command)error {fmt.Println("Greetings")returnnil        },    }md,err:=docs.ToMarkdown(app)iferr!=nil {panic(err)    }fi,err:=os.Create("cli-docs.md")iferr!=nil {panic(err)    }deferfi.Close()if_,err:=fi.WriteString("# CLI\n\n"+md);err!=nil {panic(err)    }}

This will create a filecli-docs.md with content:

#CLI#NAMEgreet - say a greeting#SYNOPSISgreet**Usage**:```greet [GLOBAL OPTIONS] [command [COMMAND OPTIONS]] [ARGUMENTS...]```

Examples

Some examples of the cli generated using this markdown

About

Extended documentation library for use with urfave/cli/v3

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors235


[8]ページ先頭

©2009-2026 Movatter.jp