diff --git a/README.md b/README.md index b531393..2c5fb26 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,29 @@ Fabric has Patterns for all sorts of life and work activities, including: ## Installation +To install Fabric, you can use the latest release binaries or install it from the source. + +### Get Latest Release Binaries + +```bash +# Windows: +curl -L https://github.com/danielmiessler/fabric/releases/latest/download/fabric-windows-amd64.exe > fabric.exe && fabric.exe --version + +# MacOS (arm64): +curl -L https://github.com/danielmiessler/fabric/releases/latest/download/fabric-darwin-arm64 > fabric && chmod +x fabric && ./fabric --version + +# MacOS (amd64): +curl -L https://github.com/danielmiessler/fabric/releases/latest/download/fabric-darwin-amd64 > fabric && chmod +x fabric && ./fabric --version + +# Linux (amd64): +curl -L https://github.com/danielmiessler/fabric/releases/latest/download/fabric-linux-amd64 > fabric && chmod +x fabric && ./fabric --version + +# Linux (arm64): +curl -L https://github.com/danielmiessler/fabric/releases/latest/download/fabric-linux-arm64 > fabric && chmod +x fabric && ./fabric --version +``` + +### From Source + To install Fabric, [make sure Go is installed](https://go.dev/doc/install), and then run the following command. ```bash diff --git a/cli/cli.go b/cli/cli.go index a47d354..dd437db 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -15,8 +15,6 @@ import ( func Cli(version string) (message string, err error) { var currentFlags *Flags if currentFlags, err = Init(); err != nil { - // we need to reset error, because we don't want to show double help messages - err = nil return } diff --git a/main.go b/main.go index 61ea3cc..088bad5 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "github.com/jessevdk/go-flags" "os" "github.com/danielmiessler/fabric/cli" @@ -12,7 +13,7 @@ var version = "dev" // Default version func main() { _, err := cli.Cli(version) - if err != nil { + if err != nil && !flags.WroteHelp(err) { fmt.Printf("%s\n", err) os.Exit(1) }