flag: move method flag from main
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
parent
da6d238d8a
commit
40d0550ad3
11
flag.go
11
flag.go
|
@ -2,6 +2,8 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
|
|
||||||
|
"git.ophivana.moe/cat/fortify/internal/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -39,3 +41,12 @@ func init() {
|
||||||
flag.BoolVar(&flagVerbose, "v", false, "Verbose output")
|
flag.BoolVar(&flagVerbose, "v", false, "Verbose output")
|
||||||
flag.BoolVar(&printVersion, "V", false, "Print version")
|
flag.BoolVar(&printVersion, "V", false, "Print version")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
methodHelpString := "Method of launching the child process, can be one of \"sudo\", \"bubblewrap\""
|
||||||
|
if util.SdBootedV {
|
||||||
|
methodHelpString += ", \"systemd\""
|
||||||
|
}
|
||||||
|
|
||||||
|
flag.StringVar(&launchOptionText, "method", "sudo", methodHelpString)
|
||||||
|
}
|
||||||
|
|
10
main.go
10
main.go
|
@ -16,7 +16,6 @@ import (
|
||||||
"git.ophivana.moe/cat/fortify/internal/app"
|
"git.ophivana.moe/cat/fortify/internal/app"
|
||||||
"git.ophivana.moe/cat/fortify/internal/state"
|
"git.ophivana.moe/cat/fortify/internal/state"
|
||||||
"git.ophivana.moe/cat/fortify/internal/system"
|
"git.ophivana.moe/cat/fortify/internal/system"
|
||||||
"git.ophivana.moe/cat/fortify/internal/util"
|
|
||||||
"git.ophivana.moe/cat/fortify/internal/verbose"
|
"git.ophivana.moe/cat/fortify/internal/verbose"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -31,15 +30,6 @@ var (
|
||||||
launchOptionText string
|
launchOptionText string
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
|
||||||
methodHelpString := "Method of launching the child process, can be one of \"sudo\", \"bubblewrap\""
|
|
||||||
if util.SdBootedV {
|
|
||||||
methodHelpString += ", \"systemd\""
|
|
||||||
}
|
|
||||||
|
|
||||||
flag.StringVar(&launchOptionText, "method", "sudo", methodHelpString)
|
|
||||||
}
|
|
||||||
|
|
||||||
func tryVersion() {
|
func tryVersion() {
|
||||||
if printVersion {
|
if printVersion {
|
||||||
fmt.Println(Version)
|
fmt.Println(Version)
|
||||||
|
|
Loading…
Reference in New Issue