fortify: move flag handling to separate files

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
2024-10-12 01:28:22 +09:00
parent 8d82446d97
commit d2575b6708
3 changed files with 30 additions and 14 deletions

24
version.go Normal file
View File

@@ -0,0 +1,24 @@
package main
import (
"flag"
"fmt"
"os"
)
var (
Version = "impure"
printVersion bool
)
func init() {
flag.BoolVar(&printVersion, "V", false, "Print version")
}
func tryVersion() {
if printVersion {
fmt.Println(Version)
os.Exit(0)
}
}