diff options
author | Felix Lange <fjl@users.noreply.github.com> | 2018-01-16 22:42:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-16 22:42:41 +0800 |
commit | f08cd94fb755471cb78091af99ef7026afb392f3 (patch) | |
tree | dbcb5f01698b4fe13d5b79ab369056fcfefada90 /cmd/ethkey/main.go | |
parent | 216e584899ed522088419438c9c605a20b5dc9ae (diff) | |
download | go-tangerine-f08cd94fb755471cb78091af99ef7026afb392f3.tar go-tangerine-f08cd94fb755471cb78091af99ef7026afb392f3.tar.gz go-tangerine-f08cd94fb755471cb78091af99ef7026afb392f3.tar.bz2 go-tangerine-f08cd94fb755471cb78091af99ef7026afb392f3.tar.lz go-tangerine-f08cd94fb755471cb78091af99ef7026afb392f3.tar.xz go-tangerine-f08cd94fb755471cb78091af99ef7026afb392f3.tar.zst go-tangerine-f08cd94fb755471cb78091af99ef7026afb392f3.zip |
cmd/ethkey: fix formatting, review nits (#15807)
This commit:
- Adds a --msgfile option to read the message to sign from a file
instead of command line argument.
- Adds a unit test for signing subcommands.
- Removes some weird whitespace in the code.
Diffstat (limited to 'cmd/ethkey/main.go')
-rw-r--r-- | cmd/ethkey/main.go | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/cmd/ethkey/main.go b/cmd/ethkey/main.go index b9b7a18e0..2a9e5ee48 100644 --- a/cmd/ethkey/main.go +++ b/cmd/ethkey/main.go @@ -28,40 +28,37 @@ const ( defaultKeyfileName = "keyfile.json" ) -var ( - gitCommit = "" // Git SHA1 commit hash of the release (set via linker flags) +// Git SHA1 commit hash of the release (set via linker flags) +var gitCommit = "" - app *cli.App // the main app instance -) +var app *cli.App -var ( // Commonly used command line flags. +func init() { + app = utils.NewApp(gitCommit, "an Ethereum key manager") + app.Commands = []cli.Command{ + commandGenerate, + commandInspect, + commandSignMessage, + commandVerifyMessage, + } +} + +// Commonly used command line flags. +var ( passphraseFlag = cli.StringFlag{ Name: "passwordfile", Usage: "the file that contains the passphrase for the keyfile", } - jsonFlag = cli.BoolFlag{ Name: "json", Usage: "output JSON instead of human-readable format", } - messageFlag = cli.StringFlag{ Name: "message", Usage: "the file that contains the message to sign/verify", } ) -// Configure the app instance. -func init() { - app = utils.NewApp(gitCommit, "an Ethereum key manager") - app.Commands = []cli.Command{ - commandGenerate, - commandInspect, - commandSignMessage, - commandVerifyMessage, - } -} - func main() { if err := app.Run(os.Args); err != nil { fmt.Fprintln(os.Stderr, err) |