add version flag -v and give it a version

This commit is contained in:
2025-12-19 08:37:48 +01:00
parent 2d2ebc51ea
commit 81e7474846

View File

@@ -28,7 +28,16 @@ import (
"github.com/alecthomas/repr" "github.com/alecthomas/repr"
) )
const VERSION = `v0.0.3`
func main() { func main() {
if len(os.Args) > 1 {
if os.Args[1] == "-v" {
fmt.Printf("This is sway-descratch version %s\n", VERSION)
os.Exit(0)
}
}
// we need a session to sway via IPC // we need a session to sway via IPC
ipc := swayipc.NewSwayIPC() ipc := swayipc.NewSwayIPC()