@@ -54,9 +54,8 @@ type ExtraFlag struct {
5454// Arguments .
5555type Arguments struct {
5656 generator.Config
57- extends []* ExtraFlag
58- queryVersion bool
59- dependencyChecker * versions.DependencyChecker
57+ extends []* ExtraFlag
58+ queryVersion bool
6059}
6160
6261const (
@@ -98,7 +97,6 @@ func (a *Arguments) buildFlags(version string) *flag.FlagSet {
9897 "Turn on verbose mode." )
9998 f .BoolVar (& a .GenerateInvoker , "invoker" , false ,
10099 "Generate invoker side codes when service name is specified." )
101- f .StringVar (& a .IDLType , "type" , "unknown" , "Specify the type of IDL: 'thrift' or 'protobuf'." )
102100 f .Var (& a .Includes , "I" , "Add an IDL search path for includes." )
103101 f .Var (& a .ThriftOptions , "thrift" , "Specify arguments for the thrift go compiler." )
104102 f .Var (& a .Hessian2Options , "hessian2" , "Specify arguments for the hessian2 codec." )
@@ -255,16 +253,11 @@ func (a *Arguments) checkIDL(files []string) error {
255253 }
256254 a .IDL = files [0 ]
257255
258- switch a .IDLType {
259- case Thrift , Protobuf :
260- case Unknown :
261- if typ , ok := guessIDLType (a .IDL ); ok {
262- a .IDLType = typ
263- } else {
264- return fmt .Errorf ("can not guess an IDL type from %q (unknown suffix), please specify with the '-type' flag" , a .IDL )
265- }
266- default :
267- return fmt .Errorf ("unsupported IDL type: %s" , a .IDLType )
256+ if typ , ok := guessIDLType (a .IDL ); ok {
257+ a .IDLType = typ
258+ } else {
259+ return fmt .Errorf ("the last parameter shoule be IDL filename (xxx.thrift or xxx.proto), for example: " +
260+ "\" kitex -service demo idl.thrift\" " )
268261 }
269262 return nil
270263}
0 commit comments