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
2
2
3
3
import (
4
4
"mjpclab.dev/ghfs/src"
5
+ "os"
5
6
)
6
7
7
8
func main () {
8
- src .Main ()
9
+ ok := src .Main ()
10
+ if ! ok {
11
+ os .Exit (1 )
12
+ }
9
13
}
Original file line number Diff line number Diff line change @@ -37,19 +37,19 @@ func reopenLogOnHup(appInst *app.App) {
37
37
}()
38
38
}
39
39
40
- func Main () {
40
+ func Main () ( ok bool ) {
41
41
// params
42
42
params , printVersion , printHelp , errs := param .ParseFromCli ()
43
43
if serverError .CheckError (errs ... ) {
44
44
return
45
45
}
46
46
if printVersion {
47
47
version .PrintVersion ()
48
- return
48
+ return true
49
49
}
50
50
if printHelp {
51
51
param .PrintHelp ()
52
- return
52
+ return true
53
53
}
54
54
55
55
// settings
@@ -77,5 +77,9 @@ func Main() {
77
77
cleanupOnEnd (appInst )
78
78
reopenLogOnHup (appInst )
79
79
errs = appInst .Open ()
80
- serverError .CheckError (errs ... )
80
+ if serverError .CheckError (errs ... ) {
81
+ return
82
+ }
83
+
84
+ return true
81
85
}
You can’t perform that action at this time.
0 commit comments