File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,12 @@ package main
22
33import (
44 "mjpclab.dev/ghfs/src"
5+ "os"
56)
67
78func main () {
8- src .Main ()
9+ ok := src .Main ()
10+ if ! ok {
11+ os .Exit (1 )
12+ }
913}
Original file line number Diff line number Diff line change @@ -37,19 +37,19 @@ func reopenLogOnHup(appInst *app.App) {
3737 }()
3838}
3939
40- func Main () {
40+ func Main () ( ok bool ) {
4141 // params
4242 params , printVersion , printHelp , errs := param .ParseFromCli ()
4343 if serverError .CheckError (errs ... ) {
4444 return
4545 }
4646 if printVersion {
4747 version .PrintVersion ()
48- return
48+ return true
4949 }
5050 if printHelp {
5151 param .PrintHelp ()
52- return
52+ return true
5353 }
5454
5555 // settings
@@ -77,5 +77,9 @@ func Main() {
7777 cleanupOnEnd (appInst )
7878 reopenLogOnHup (appInst )
7979 errs = appInst .Open ()
80- serverError .CheckError (errs ... )
80+ if serverError .CheckError (errs ... ) {
81+ return
82+ }
83+
84+ return true
8185}
You can’t perform that action at this time.
0 commit comments