[release/1.4.6] cmd, console: split off the console into a reusable package
(cherry picked from commit ffaf58f0a9
)
This commit is contained in:
@ -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 == "" {
|
||||
|
Reference in New Issue
Block a user