You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/10/29 10:49:18 UTC

[GitHub] little-cui closed pull request #471: SCB-991 Optimize args parsing

little-cui closed pull request #471: SCB-991 Optimize args parsing
URL: https://github.com/apache/incubator-servicecomb-service-center/pull/471
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/server/core/core.go b/server/core/core.go
index 545ceb74..fd313218 100644
--- a/server/core/core.go
+++ b/server/core/core.go
@@ -19,7 +19,8 @@ package core
 
 import (
 	"flag"
-	"github.com/apache/incubator-servicecomb-service-center/pkg/grace"
+	// import the grace package and parse grace cmd line
+	_ "github.com/apache/incubator-servicecomb-service-center/pkg/grace"
 	"github.com/apache/incubator-servicecomb-service-center/pkg/log"
 	"github.com/apache/incubator-servicecomb-service-center/version"
 	"os"
@@ -41,16 +42,12 @@ func Initialize() {
 func ParseCommandLine() {
 	var printVer bool
 	flag.BoolVar(&printVer, "v", false, "Print the version and exit.")
-	flag.CommandLine.Init(os.Args[0], flag.ContinueOnError)
-	flag.CommandLine.Parse(os.Args[1:])
+	flag.Parse()
 
 	if printVer {
 		version.Ver().Print()
 		os.Exit(0)
 	}
-
-	// import the grace package and parse grace cmd line
-	grace.ParseCommandLine()
 }
 
 func handleSignals() {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services