@ -75,18 +75,23 @@ func (app *appContext) loadArgs(firstCall bool) {
os . Setenv ( "JFA_DATAPATH" , app . dataPath )
os . Setenv ( "JFA_DATAPATH" , app . dataPath )
}
}
/ * Adds start / stop / systemd to help message , and
/ *
Adds start / stop / systemd to help message , and
also gets rid of usage for shorthand flags , and merge them with the full - length one .
also gets rid of usage for shorthand flags , and merge them with the full - length one .
implementation is 🤢 , will clean this up eventually .
implementation is 🤢 , will clean this up eventually .
- h SHORTHAND
- h SHORTHAND
- help
- help
prints this message .
prints this message .
becomes :
becomes :
- help , - h
- help , - h
prints this message .
prints this message .
* /
* /
func helpFunc ( ) {
func helpFunc ( ) {
fmt . Fprint ( o s. S tderr, ` Usage of jfa - go :
fmt . Fprint ( stderr, ` Usage of jfa - go :
start
start
start jfa - go as a daemon and run in the background .
start jfa - go as a daemon and run in the background .
stop
stop
@ -99,7 +104,7 @@ func helpFunc() {
// Write defaults into buffer then remove any shorthands
// Write defaults into buffer then remove any shorthands
flag . CommandLine . SetOutput ( & b )
flag . CommandLine . SetOutput ( & b )
flag . PrintDefaults ( )
flag . PrintDefaults ( )
flag . CommandLine . SetOutput ( o s. S tderr)
flag . CommandLine . SetOutput ( stderr)
scanner := bufio . NewScanner ( & b )
scanner := bufio . NewScanner ( & b )
out := ""
out := ""
line := scanner . Text ( )
line := scanner . Text ( )
@ -150,5 +155,5 @@ func helpFunc() {
lastLine = true
lastLine = true
}
}
}
}
fmt . Fprint ( o s. S tderr, out )
fmt . Fprint ( stderr, out )
}
}