aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils/flags.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-03-10 05:51:50 +0800
committerFelix Lange <fjl@twurst.com>2015-03-10 06:08:46 +0800
commit73d1ebe244644c2d74a1c0c38a3b339e72140886 (patch)
tree34acef048536af9ed631a7badb6eb1d0010129ca /cmd/utils/flags.go
parentb4fa94c4b1459e71d4f11a3178cf56edf2b4aed3 (diff)
downloadgo-tangerine-73d1ebe244644c2d74a1c0c38a3b339e72140886.tar.gz
go-tangerine-73d1ebe244644c2d74a1c0c38a3b339e72140886.tar.zst
go-tangerine-73d1ebe244644c2d74a1c0c38a3b339e72140886.zip
cmd/utils: add NewApp
Diffstat (limited to 'cmd/utils/flags.go')
-rw-r--r--cmd/utils/flags.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index e6eee20a7..2156963c4 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -19,6 +19,17 @@ import (
"github.com/ethereum/go-ethereum/p2p/nat"
)
+// NewApp creates an app with sane defaults.
+func NewApp(version, usage string) *cli.App {
+ app := cli.NewApp()
+ app.Name = path.Base(os.Args[0])
+ app.Author = ""
+ app.Email = ""
+ app.Version = version
+ app.Usage = usage
+ return app
+}
+
// These are all the command line flags we support.
// If you add to this list, please remember to include the
// flag in the appropriate command definition.