mirror of
https://github.com/EnumeratedDev/bpm-utils.git
synced 2026-09-16 11:06:11 +00:00
Move help message and flag setup to bpm-utils-shared package
This commit is contained in:
+3
-14
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user