Skip to content

Commit

Permalink
Add a few badges, prep for 1.0 (#2)
Browse files Browse the repository at this point in the history
* Add a few badges, prep for 1.0

* fix up some godoc
  • Loading branch information
ldemailly authored Feb 19, 2023
1 parent 5e83eb5 commit 2e05b2e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[![Go Reference](https://pkg.go.dev/badge/fortio.org/cli.svg)](https://pkg.go.dev/fortio.org/cli)
[![Go Report Card](https://goreportcard.com/badge/fortio.org/cli)](https://goreportcard.com/report/fortio.org/cli)
[![GitHub Release](https://img.shields.io/github/release/fortio/cli.svg?style=flat)](https://github.com/fortio/cli/releases/)

# cli
Reduce boiler plate needed on each new Golang main functions (Command Line Interface) for both tools and servers (use [fortio.org/scli ServerMain()](https://github.com/fortio/scli#scli) for server)

Expand Down
6 changes: 3 additions & 3 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// Package cli contains utilities for command line tools and server main()s
// to handle flags, arguments, version, logging ([fortio.org/log]), etc...
// Configure using the package variables (at minimum [MinArgs] unless your
// binary only accepts flags), setup additional [flag]s before calling
// [Main] or [fortio.org/scli.ServerMain()] for configmap and dynamic flags
// binary only accepts flags), setup additional [flag] before calling
// [Main] or [fortio.org/scli.ServerMain] for configmap and dynamic flags
// setup.
package cli // import "fortio.org/cli"

Expand Down Expand Up @@ -63,7 +63,7 @@ func usage(w io.Writer, msg string, args ...any) {

// Main handles your commandline and flag parsing. Sets up flags first then call Main.
// For a server with dynamic flags, call ServerMain instead.
// Will either have called ExitFunction() (defaults to [os.Exit])
// Will either have called [ExitFunction] (defaults to [os.Exit])
// or returned if all validations passed.
func Main() {
quietFlag := flag.Bool("quiet", false, "Quiet mode, sets log level to warning")
Expand Down

0 comments on commit 2e05b2e

Please sign in to comment.