Skip to content

Commit

Permalink
feature: add flag to show app version
Browse files Browse the repository at this point in the history
  • Loading branch information
abanoubha committed Jul 2, 2024
1 parent 266c0e6 commit a2fabcc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
const coreFormulasFile = "core_formulas.json"

var (
version bool
buildDep bool
statistics bool
lang string
Expand All @@ -34,6 +35,8 @@ gobrew -d go # show all dependants of certain language/lib.
gobrew -s # show all languages and the count of packages which depends on each one of them.`,
}

rootCmd.Flags().BoolVarP(&version, "version", "v", false, "show the release version of gobrew")

rootCmd.Flags().BoolVarP(&buildDep, "build-dep", "b", false, "show building dependencies for all packages in Homebrew Core")

rootCmd.Flags().BoolVarP(&statistics, "statistics", "s", false, "show all languages and the count of packages which depends on each one of them")
Expand All @@ -51,6 +54,8 @@ gobrew -s # show all languages and the count of packages which depen
getPackageCount(coreFormulasFile, lang)
} else if dependants != "" {
getDependants(coreFormulasFile, dependants)
} else if version {
fmt.Println("gobrew v24.07.04")
} else {
fmt.Println("No language nor build system nor library is specified. Counting packages built in Go (by default):")
getPackageCount(coreFormulasFile, "go")
Expand Down

0 comments on commit a2fabcc

Please sign in to comment.