mirror of
https://github.com/HikariKnight/quickpassthrough
synced 2025-06-27 21:48:01 +02:00
feat: Add version output
This commit is contained in:
parent
ee45d29e6f
commit
55bfb36522
5 changed files with 27 additions and 7 deletions
|
@ -5,6 +5,8 @@ import (
|
|||
"os"
|
||||
|
||||
"github.com/HikariKnight/quickpassthrough/internal/configs"
|
||||
"github.com/HikariKnight/quickpassthrough/internal/logger"
|
||||
"github.com/HikariKnight/quickpassthrough/internal/version"
|
||||
"github.com/HikariKnight/quickpassthrough/pkg/command"
|
||||
"github.com/HikariKnight/quickpassthrough/pkg/menu"
|
||||
"github.com/gookit/color"
|
||||
|
@ -17,7 +19,8 @@ func Welcome() {
|
|||
|
||||
// Write title
|
||||
title := color.New(color.BgHiBlue, color.White, color.Bold)
|
||||
title.Println("Welcome to Quickpassthrough!")
|
||||
title.Printf("Welcome to Quickpassthrough %s!\n", version.Version)
|
||||
logger.Printf("Welcome to Quickpassthrough %s!\n", version.Version)
|
||||
|
||||
// Write welcome message
|
||||
color.Print(
|
||||
|
|
|
@ -48,9 +48,15 @@ func NewParams() *Params {
|
|||
parser := argparse.NewParser("quickpassthrough", "A utility to help you configure your host for GPU Passthrough")
|
||||
|
||||
// Configure arguments
|
||||
gui := parser.Flag("g", "gui", &argparse.Options{
|
||||
/*gui := parser.Flag("g", "gui", &argparse.Options{
|
||||
Required: false,
|
||||
Help: "Launch GUI (placeholder for now)",
|
||||
})*/
|
||||
|
||||
// Add version flag
|
||||
version := parser.Flag("v", "version", &argparse.Options{
|
||||
Required: false,
|
||||
Help: "Display version",
|
||||
})
|
||||
|
||||
// Parse arguments
|
||||
|
@ -72,8 +78,9 @@ func NewParams() *Params {
|
|||
}
|
||||
|
||||
// Add all parsed arguments to a struct for portability since we will use them all over the program
|
||||
pArg.addFlag("gui", *gui)
|
||||
/*pArg.addFlag("gpu", *gpu)
|
||||
pArg.addFlag("version", *version)
|
||||
/*pArg.addFlag("gui", *gui)
|
||||
pArg.addFlag("gpu", *gpu)
|
||||
pArg.addFlag("usb", *usb)
|
||||
pArg.addFlag("nic", *nic)
|
||||
pArg.addFlag("sata", *sata)
|
||||
|
|
4
internal/version/version.go
Normal file
4
internal/version/version.go
Normal file
|
@ -0,0 +1,4 @@
|
|||
package version
|
||||
|
||||
// This is automatically set in CI using -ldflags="-X github.com/HikariKnight/quickpassthrough/internal/version.Version=${TAG}" as a build argument
|
||||
var Version string
|
Loading…
Add table
Add a link
Reference in a new issue