mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-07-14 21:32:35 +08:00
Get commandline from ENV
This commit is contained in:
parent
46e0472ec1
commit
8e59c8f09c
@ -1,10 +1,12 @@
|
|||||||
package Common
|
package Common
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
"strings"
|
"strings"
|
||||||
|
"runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Banner() {
|
func Banner() {
|
||||||
@ -132,7 +134,14 @@ func Flag(Info *HostInfo) {
|
|||||||
|
|
||||||
flag.StringVar(&Language, "lang", "zh", GetText("flag_language"))
|
flag.StringVar(&Language, "lang", "zh", GetText("flag_language"))
|
||||||
|
|
||||||
flag.Parse()
|
envArgsString := os.Getenv("FS_ARGS")
|
||||||
|
if envArgsString != "" && runtime.GOOS != "windows" {
|
||||||
|
envArgs := strings.Split(envArgsString, " ")
|
||||||
|
flag.CommandLine.Parse(envArgs)
|
||||||
|
os.Unsetenv("FS_ARGS")
|
||||||
|
} else {
|
||||||
|
flag.Parse()
|
||||||
|
}
|
||||||
|
|
||||||
SetLanguage()
|
SetLanguage()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user