Support input from args

This commit is contained in:
obscuren 2015-01-09 12:04:54 +01:00
parent c8a4c04b36
commit 585f259b63
1 changed files with 6 additions and 1 deletions

View File

@ -28,6 +28,7 @@ import (
"io/ioutil"
"log"
"os"
"strings"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/ethutil"
@ -126,5 +127,9 @@ func RunVmTest(r io.Reader) (failed int) {
func main() {
helper.Logger.SetLogLevel(5)
os.Exit(RunVmTest(os.Stdin))
if len(os.Args) > 1 {
os.Exit(RunVmTest(strings.NewReader(os.Args[1])))
} else {
os.Exit(RunVmTest(os.Stdin))
}
}