From 8bf22248442e7e5b45d9bd2987bf675201dc3d77 Mon Sep 17 00:00:00 2001 From: mr-pmillz <> Date: Tue, 3 Sep 2024 18:50:12 -0400 Subject: [PATCH] show usage when no flags specified --- README.md | 2 +- cmd/eoldate/main.go | 5 +++++ eoldate.go | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e028279..6069a0f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ An End of Life Date API SDK written in Go -This is a fairly simple wrapper around the endoflife.date API +This is a wrapper around the endoflife.date API [Read the Docs](https://endoflife.date/docs/api) ## Installation diff --git a/cmd/eoldate/main.go b/cmd/eoldate/main.go index 2086a8f..9e4dab3 100644 --- a/cmd/eoldate/main.go +++ b/cmd/eoldate/main.go @@ -52,6 +52,11 @@ func main() { os.Exit(0) } + if eolOptions.Tech == "" { + gologger.Info().Msg("No technologies specified") + flag.Usage() + os.Exit(1) + } releaseVersions, err := client.GetProduct(eolOptions.Tech) if err != nil { fmt.Printf("Error fetching product data: %v\n", err) diff --git a/eoldate.go b/eoldate.go index 1ce3482..299057e 100644 --- a/eoldate.go +++ b/eoldate.go @@ -7,7 +7,7 @@ import ( "net/http" ) -const CurrentVersion = `v0.0.2` +const CurrentVersion = `v0.0.3` const EOLBaseURL = "https://endoflife.date/api" // Options ...