diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 0091b22..8958d8b 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -16,11 +16,11 @@ builds: - CGO_ENABLED=0 goos: - linux - goarch: - amd64 mod_timestamp: "{{ .CommitTimestamp }}" - + ldflags: + - -s -w -X version.Version={{.Version}} archives: - format: tar.gz # this name template makes the OS and Arch compatible with the results of `uname`. diff --git a/cmd/main.go b/cmd/main.go index 5973bf6..661b272 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -1,15 +1,23 @@ package main import ( + "fmt" + internal "github.com/HikariKnight/quickpassthrough/internal" downloader "github.com/HikariKnight/quickpassthrough/internal/ls_iommu_downloader" "github.com/HikariKnight/quickpassthrough/internal/params" + "github.com/HikariKnight/quickpassthrough/internal/version" ) func main() { // Get all our arguments in 1 neat struct pArg := params.NewParams() + // Display the version + if p.Arg.Flag["version"] { + fmt.Printf("QuickPassthrough Version %s\n", version.Version) + } + if !pArg.Flag["gui"] { downloader.CheckLsIOMMU() internal.Tui() diff --git a/internal/version/version.go b/internal/version/version.go new file mode 100644 index 0000000..c50b3ee --- /dev/null +++ b/internal/version/version.go @@ -0,0 +1,3 @@ +package version + +type Version string