[release/1.4.6] cmd, console: split off the console into a reusable package

(cherry picked from commit ffaf58f0a9)
This commit is contained in:
Péter Szilágyi
2016-05-06 12:40:23 +03:00
parent af53767e16
commit c39de61a0a
26 changed files with 1548 additions and 1519 deletions

View File

@ -45,6 +45,7 @@ type testgeth struct {
// template variables for expect
Datadir string
Executable string
Etherbase string
Func template.FuncMap
removeDatadir bool
@ -67,11 +68,15 @@ func init() {
func runGeth(t *testing.T, args ...string) *testgeth {
tt := &testgeth{T: t, Executable: os.Args[0]}
for i, arg := range args {
if arg == "-datadir" || arg == "--datadir" {
switch {
case arg == "-datadir" || arg == "--datadir":
if i < len(args)-1 {
tt.Datadir = args[i+1]
}
break
case arg == "-etherbase" || arg == "--etherbase":
if i < len(args)-1 {
tt.Etherbase = args[i+1]
}
}
}
if tt.Datadir == "" {