2018-03-30 16:15:06 +00:00
|
|
|
package vm
|
|
|
|
|
|
|
|
import (
|
2021-02-10 08:53:01 +00:00
|
|
|
"os"
|
|
|
|
|
2022-02-15 12:55:25 +00:00
|
|
|
"github.com/chzyer/readline"
|
2022-08-05 10:32:37 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/cli/cmdargs"
|
2018-03-30 16:15:06 +00:00
|
|
|
"github.com/urfave/cli"
|
|
|
|
)
|
|
|
|
|
2019-10-19 20:58:45 +00:00
|
|
|
// NewCommands returns 'vm' command.
|
|
|
|
func NewCommands() []cli.Command {
|
|
|
|
return []cli.Command{{
|
2018-03-30 16:15:06 +00:00
|
|
|
Name: "vm",
|
|
|
|
Usage: "start the virtual machine",
|
|
|
|
Action: startVMPrompt,
|
2022-10-03 12:05:42 +00:00
|
|
|
Flags: []cli.Flag{},
|
2019-10-19 20:58:45 +00:00
|
|
|
}}
|
2018-03-30 16:15:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func startVMPrompt(ctx *cli.Context) error {
|
2022-08-05 10:32:37 +00:00
|
|
|
if err := cmdargs.EnsureNone(ctx); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2022-10-05 09:30:54 +00:00
|
|
|
p := NewWithConfig(true, os.Exit, &readline.Config{})
|
2018-03-30 16:15:06 +00:00
|
|
|
return p.Run()
|
|
|
|
}
|