Merge pull request #829 from nspcc-dev/fix/compiler
cli: rename `contract compile` --debug flag
This commit is contained in:
commit
5cd096381f
2 changed files with 7 additions and 9 deletions
|
@ -89,11 +89,11 @@ func NewCommands() []cli.Command {
|
||||||
Usage: "Output of the compiled contract",
|
Usage: "Output of the compiled contract",
|
||||||
},
|
},
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "debug, d",
|
Name: "verbose, v",
|
||||||
Usage: "Debug mode will print out additional information after a compiling",
|
Usage: "Print out additional information after a compiling",
|
||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "emitdebug",
|
Name: "debug, d",
|
||||||
Usage: "Emit debug info in a separate file",
|
Usage: "Emit debug info in a separate file",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -351,16 +351,17 @@ func contractCompile(ctx *cli.Context) error {
|
||||||
|
|
||||||
o := &compiler.Options{
|
o := &compiler.Options{
|
||||||
Outfile: ctx.String("out"),
|
Outfile: ctx.String("out"),
|
||||||
Debug: ctx.Bool("debug"),
|
|
||||||
|
|
||||||
DebugInfo: ctx.String("emitdebug"),
|
DebugInfo: ctx.String("debug"),
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := compiler.CompileAndSave(src, o)
|
result, err := compiler.CompileAndSave(src, o)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return cli.NewExitError(err, 1)
|
return cli.NewExitError(err, 1)
|
||||||
}
|
}
|
||||||
fmt.Println(hex.EncodeToString(result))
|
if ctx.Bool("verbose") {
|
||||||
|
fmt.Println(hex.EncodeToString(result))
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,9 +26,6 @@ type Options struct {
|
||||||
|
|
||||||
// The name of the output for debug info.
|
// The name of the output for debug info.
|
||||||
DebugInfo string
|
DebugInfo string
|
||||||
|
|
||||||
// Debug outputs a hex encoded string of the generated bytecode.
|
|
||||||
Debug bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type buildInfo struct {
|
type buildInfo struct {
|
||||||
|
|
Loading…
Reference in a new issue