Move help message and flag setup to bpm-utils-shared package

This commit is contained in:
2025-05-04 17:52:29 +03:00
parent a6578fb414
commit 5a7995d226
5 changed files with 51 additions and 47 deletions
+3 -14
View File
@@ -21,8 +21,9 @@ var installPackage = flag.Bool("i", false, "Install compiled BPM package after c
var yesAll = flag.Bool("y", false, "Accept all confirmation prompts")
func main() {
// Setup flags
setupFlags()
// Setup flags and help
bpmutilsshared.SetupHelp("bpm-package <options>", "Generates source BPM package from current directory")
bpmutilsshared.SetupFlags()
// Run checks
runChecks()
@@ -35,18 +36,6 @@ func main() {
}
}
func setupFlags() {
flag.Usage = help
flag.Parse()
}
func help() {
fmt.Println("Usage: bpm-package <options>")
fmt.Println("Description: Generates source BPM package from current directory")
fmt.Println("Options:")
flag.PrintDefaults()
}
func runChecks() {
// Check if pkg.info file exists
if stat, err := os.Stat("pkg.info"); err != nil || !stat.Mode().IsRegular() {