@@ -31,8 +31,8 @@ const (
31
31
32
32
var (
33
33
supportedLanguage = []string {"English" , "中文" }
34
- validArgs = []string {"endpoint" , "wallet" , "explorer" , "defaultacc" , "language" }
35
- validGetArgs = []string {"endpoint" , "wallet" , "explorer" , "defaultacc" , "language" , "all" }
34
+ validArgs = []string {"endpoint" , "wallet" , "explorer" , "defaultacc" , "language" , "nsv2height" }
35
+ validGetArgs = []string {"endpoint" , "wallet" , "explorer" , "defaultacc" , "language" , "nsv2height" , " all" }
36
36
validExpl = []string {"iotexscan" , "iotxplorer" }
37
37
endpointCompile = regexp .MustCompile ("^" + endpointPattern + "$" )
38
38
)
@@ -149,6 +149,9 @@ func Get(arg string) error {
149
149
case "language" :
150
150
output .PrintResult (ReadConfig .Language )
151
151
return nil
152
+ case "nsv2height" :
153
+ fmt .Println (ReadConfig .Nsv2height )
154
+ return nil
152
155
case "all" :
153
156
fmt .Println (ReadConfig .String ())
154
157
return nil
@@ -267,6 +270,12 @@ func set(args []string) error {
267
270
args [1 ], supportedLanguage ), nil )
268
271
}
269
272
ReadConfig .Language = supportedLanguage [language ]
273
+ case "nsv2height" :
274
+ height , err := strconv .ParseUint (args [1 ], 10 , 64 )
275
+ if err != nil {
276
+ return output .NewError (output .ValidationError , "invalid height" , nil )
277
+ }
278
+ ReadConfig .Nsv2height = height
270
279
}
271
280
err := writeConfig ()
272
281
if err != nil {
0 commit comments