diff --git a/cmd/iffmaster/main.go b/cmd/iffmaster/main.go index 5778b1b..c4f7e28 100644 --- a/cmd/iffmaster/main.go +++ b/cmd/iffmaster/main.go @@ -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() + } }