From 3179311ae0db9e79e94ed13e4f8312faf1823b8f Mon Sep 17 00:00:00 2001 From: mountain Date: Tue, 20 Jun 2023 17:10:24 +0900 Subject: [PATCH] =?UTF-8?q?flag.parse=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flags.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/flags.go b/flags.go index 8a0bbb9..01400f9 100644 --- a/flags.go +++ b/flags.go @@ -1,6 +1,9 @@ package gocommon -import "flag" +import ( + "flag" + "os" +) var commandLine = flag.NewFlagSet("gocommon", flag.ExitOnError) var devflag = commandLine.Bool("dev", false, "") @@ -11,3 +14,7 @@ var tls = commandLine.String("tls", "", "") var NoSessionFlag = commandLine.Bool("nosession", false, "nosession=[true|false]") var NeedPrefetch = commandLine.Bool("prefetch", false, "") var Linkupdate = commandLine.String("updatelink", "", "") + +func init() { + commandLine.Parse(os.Args[1:]) +}