aboutsummaryrefslogtreecommitdiffstats
path: root/ethereal/flags.go
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2014-06-23 19:38:23 +0800
committerzelig <viktor.tron@gmail.com>2014-06-23 19:38:23 +0800
commit6f09a3e8200ba2eeeeb296141d6644d04078a9c4 (patch)
tree516540d7a13bb60c4bf35d03782a1b2f0df9400f /ethereal/flags.go
parent34284b7532e753b7fe67a11d8fe19ba4afd9066f (diff)
downloaddexon-6f09a3e8200ba2eeeeb296141d6644d04078a9c4.tar
dexon-6f09a3e8200ba2eeeeb296141d6644d04078a9c4.tar.gz
dexon-6f09a3e8200ba2eeeeb296141d6644d04078a9c4.tar.bz2
dexon-6f09a3e8200ba2eeeeb296141d6644d04078a9c4.tar.lz
dexon-6f09a3e8200ba2eeeeb296141d6644d04078a9c4.tar.xz
dexon-6f09a3e8200ba2eeeeb296141d6644d04078a9c4.tar.zst
dexon-6f09a3e8200ba2eeeeb296141d6644d04078a9c4.zip
fix imports in ui_lib and flags cos of defaultAssetPath move; fix logLevel type for gui
Diffstat (limited to 'ethereal/flags.go')
-rw-r--r--ethereal/flags.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/ethereal/flags.go b/ethereal/flags.go
index 18f55071a..5975439c9 100644
--- a/ethereal/flags.go
+++ b/ethereal/flags.go
@@ -1,7 +1,15 @@
package main
import (
+ "fmt"
+ "os"
+ "os/user"
+ "path"
+ "github.com/ethereum/eth-go/ethlog"
"flag"
+ "bitbucket.org/kardianos/osext"
+ "path/filepath"
+ "runtime"
)
var Identifier string
@@ -59,6 +67,11 @@ func defaultDataDir() string {
var defaultConfigFile = path.Join(defaultDataDir(), "conf.ini")
func Init() {
+ flag.Usage = func() {
+ fmt.Fprintf(os.Stderr, "%s [options] [filename]:\noptions precedence: default < config file < environment variables < command line", os.Args[0])
+ flag.PrintDefaults()
+ }
+
flag.StringVar(&Identifier, "id", "", "Custom client identifier")
flag.StringVar(&OutboundPort, "port", "30303", "listening port")
flag.BoolVar(&UseUPnP, "upnp", false, "enable UPnP support")
@@ -75,7 +88,7 @@ func Init() {
flag.StringVar(&ConfigFile, "conf", defaultConfigFile, "config file")
flag.StringVar(&DebugFile, "debug", "", "debug file (no debugging if not set)")
flag.IntVar(&LogLevel, "loglevel", int(ethlog.InfoLevel), "loglevel: 0-4: silent,error,warn,info,debug)")
- flag.StringVar(&AssetPath, "asset_path", defaultAssetPath, "absolute path to GUI assets directory")
+ flag.StringVar(&AssetPath, "asset_path", defaultAssetPath(), "absolute path to GUI assets directory")
flag.Parse()
}