diff options
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/ior/main.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cmd/ior/main.go b/cmd/ior/main.go index 8d93d28..ebd3ef3 100644 --- a/cmd/ior/main.go +++ b/cmd/ior/main.go @@ -23,9 +23,17 @@ func main() { os.Exit(2) } - // Run the internal logic of the application. // flags.Get() is called here at the CLI boundary so internal code never reads the singleton. - if err := internal.Run(flags.Get()); err != nil { + cfg := flags.Get() + + // Handle -version: print the banner plus version and exit. + if cfg.ShowVersion { + flags.PrintVersion() + return + } + + // Run the internal logic of the application. + if err := internal.Run(cfg); err != nil { fmt.Printf("Failed to run: %v\n", err) os.Exit(2) } |
