Skip to content

Latest commit

 

History

History
26 lines (16 loc) · 790 Bytes

README.md

File metadata and controls

26 lines (16 loc) · 790 Bytes

cli package notes

Example usage

For a minimal usage example see the following file set:

Run the example

cd $GOPATH/src/github.com/gigawattio/go-commons/pkg/web/cli/example
go run example.go

Output:

Successfully started web service on addr=127.0.0.1:8080
^C
Interrupt signal detected, shutting down..

Additional notes

A few variables in the package gopkg.in/urface/cli.v2 do get temporarily overridden during the invocation of Cli.Main() until the function is done running. The overrides are:

  • cliv2.OsExiter is temporarily set to a NOP function.
  • cliv2.ErrWriter is temporarily set to the value of Cli.App.ErrWriter.