Skip to content

Commit

Permalink
add command line option to display application version
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrust committed Dec 26, 2024
1 parent 1d9898a commit 6fdf979
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions cmd/iffmaster/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,38 @@
/*
Iffmaster is a tool to inspect IFF files as defined under EA-85.
Usage:
Usage: [options]
iffmaster
There aren't any command line options yet.
-version: Show the application's version.
*/
package main

import "github.com/mattrust/iffmaster/internal/gui"
import (
"flag"
"fmt"
"os"

"github.com/mattrust/iffmaster/internal/gui"
)

const version = "1.0.0"

func main() {
gui.OpenGUI()
showVersion := flag.Bool("version", false, "Display the version of iffmaster")
flag.Parse()

if *showVersion {
fmt.Println("iffmaster version", version)
os.Exit(0)
}

if flag.NArg() > 0 {
//filename := flag.Arg(0)
//fmt.Println("Filename provided:", filename)
// You can add code here to handle the filename, e.g., open the file
} else {
gui.OpenGUI()
}
}

0 comments on commit 6fdf979

Please sign in to comment.