@@ -244,25 +244,23 @@ func (c *Console) AutoCompleteInput(line string, pos int) (string, []string, str
244
244
// console's available modules.
245
245
func (c * Console ) Welcome () {
246
246
// Print some generic Geth metadata
247
+ fmt .Fprintf (c .printer , "Welcome to the Geth JavaScript console!\n \n " )
247
248
c .jsre .Run (`
248
- (function () {
249
- console.log("Welcome to the Geth JavaScript console!\n");
250
- console.log("instance: " + web3.version.node);
251
- console.log("coinbase: " + eth.coinbase);
252
- console.log("at block: " + eth.blockNumber + " (" + new Date(1000 * eth.getBlock(eth.blockNumber).timestamp) + ")");
253
- console.log(" datadir: " + admin.datadir);
254
- })();
255
- ` )
249
+ console.log("instance: " + web3.version.node);
250
+ console.log("coinbase: " + eth.coinbase);
251
+ console.log("at block: " + eth.blockNumber + " (" + new Date(1000 * eth.getBlock(eth.blockNumber).timestamp) + ")");
252
+ console.log(" datadir: " + admin.datadir);
253
+ ` )
256
254
// List all the supported modules for the user to call
257
255
if apis , err := c .client .SupportedModules (); err == nil {
258
256
modules := make ([]string , 0 , len (apis ))
259
257
for api , version := range apis {
260
258
modules = append (modules , fmt .Sprintf ("%s:%s" , api , version ))
261
259
}
262
260
sort .Strings (modules )
263
- c . jsre . Run ( "(function () { console.log(' modules: " + strings .Join (modules , " " ) + "'); })();" )
261
+ fmt . Fprintln ( c . printer , " modules:" , strings .Join (modules , " " ))
264
262
}
265
- c . jsre . Run ( "(function () { console.log(); })();" )
263
+ fmt . Fprintln ( c . printer )
266
264
}
267
265
268
266
// Evaluate executes code and pretty prints the result to the specified output
0 commit comments