Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
032ab665
Commit
032ab665
authored
Jan 07, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added version flag
parent
60d9611c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
flags.go
cmd/ethereum/flags.go
+2
-0
main.go
cmd/ethereum/main.go
+15
-0
No files found.
cmd/ethereum/flags.go
View file @
032ab665
...
...
@@ -64,6 +64,7 @@ var (
ImportChain
string
SHH
bool
Dial
bool
PrintVersion
bool
)
// flags specific to cli client
...
...
@@ -120,6 +121,7 @@ func Init() {
flag
.
BoolVar
(
&
StartMining
,
"mine"
,
false
,
"start dagger mining"
)
flag
.
BoolVar
(
&
StartJsConsole
,
"js"
,
false
,
"launches javascript console"
)
flag
.
BoolVar
(
&
PrintVersion
,
"version"
,
false
,
"prints version number"
)
flag
.
Parse
()
...
...
cmd/ethereum/main.go
View file @
032ab665
...
...
@@ -52,6 +52,11 @@ func main() {
// precedence: code-internal flag default < config file < environment variables < command line
Init
()
// parsing command line
if
PrintVersion
{
printVersion
()
return
}
utils
.
InitConfig
(
VmType
,
ConfigFile
,
Datadir
,
"ETH"
)
ethereum
,
err
:=
eth
.
New
(
&
eth
.
Config
{
...
...
@@ -137,3 +142,13 @@ func main() {
// this blocks the thread
ethereum
.
WaitForShutdown
()
}
func
printVersion
()
{
fmt
.
Printf
(
`%v %v
PV=%d
GOOS=%s
GO=%s
GOPATH=%s
GOROOT=%s
`
,
ClientIdentifier
,
Version
,
eth
.
ProtocolVersion
,
runtime
.
GOOS
,
runtime
.
Version
(),
os
.
Getenv
(
"GOPATH"
),
runtime
.
GOROOT
())
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment