Skip to content

Commit

Permalink
Support exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
hzyitc committed Oct 9, 2022
1 parent eaeed9e commit 5942c11
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func usage() {
func main() {
if len(os.Args) != 4 {
usage()
return
os.Exit(1)
}

switch os.Args[1] {
Expand All @@ -28,29 +28,29 @@ func main() {
err := unpack(os.Args[2], os.Args[3])
if err != nil {
println(err.Error())
return
os.Exit(1)
}

case "pack":
err := pack(os.Args[2], os.Args[3])
if err != nil {
println(err.Error())
return
os.Exit(1)
}
case "res_unpack":
os.MkdirAll(os.Args[3], 0755)

err := res_unpack(os.Args[2], os.Args[3])
if err != nil {
println(err.Error())
return
os.Exit(1)
}

case "res_pack":
err := res_pack(os.Args[2], os.Args[3])
if err != nil {
println(err.Error())
return
os.Exit(1)
}
}
}

0 comments on commit 5942c11

Please sign in to comment.