diff --git a/cmd/appherder/cli.go b/cmd/appherder/cli.go index 061cfe9..bcb2aac 100644 --- a/cmd/appherder/cli.go +++ b/cmd/appherder/cli.go @@ -12,10 +12,12 @@ import ( func newRootCommand(a appherder.App, stdout io.Writer, stderr io.Writer) *cobra.Command { cmd := &cobra.Command{ Use: "appherder", - Short: "A herder for your AppImages", - Long: "appherder installs AppImages so they show up in your application menu with their\n" + - "real name and icon, instead of sitting in a folder doing nothing. Drop AppImages in\n" + - "~/AppImages and appherder keeps everything in sync.", + Short: "A shepherd for your AppImages", + Long: "appherder manages your AppImages for you. Drop them in ~/AppImages and they show\n" + + "up in your menu like any other app, with their real name and icon. New versions\n" + + "replace the old ones. Add or remove AppImages and appherder sorts it out,\n" + + "optionally on its own.", + Version: version, SilenceUsage: true, SilenceErrors: true, } diff --git a/cmd/appherder/main.go b/cmd/appherder/main.go index 52968fd..42e9239 100644 --- a/cmd/appherder/main.go +++ b/cmd/appherder/main.go @@ -7,6 +7,8 @@ import ( "github.com/alyraffauf/appherder/internal/appherder" ) +var version = "dev" + func main() { cmd := newRootCommand(appherder.NewApp(), os.Stdout, os.Stderr) cmd.SetArgs(os.Args[1:]) diff --git a/package.nix b/package.nix index 11c064d..f4bf4e3 100644 --- a/package.nix +++ b/package.nix @@ -1,11 +1,14 @@ { buildGoModule, lib, -}: -buildGoModule { - pname = "appherder"; +}: let version = "dev"; - src = ./.; - vendorHash = "sha256-cnxgWLpc8l/dvJHgj1PkJrSYmsH88pCTISM+pf7Ulg4="; - subPackages = ["cmd/appherder"]; -} +in + buildGoModule { + pname = "appherder"; + inherit version; + src = ./.; + vendorHash = "sha256-cnxgWLpc8l/dvJHgj1PkJrSYmsH88pCTISM+pf7Ulg4="; + subPackages = ["cmd/appherder"]; + ldflags = ["-X main.version=${version}"]; + }