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
73d1ebe2
Commit
73d1ebe2
authored
Mar 09, 2015
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/utils: add NewApp
parent
b4fa94c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
main.go
cmd/ethereum/main.go
+1
-5
flags.go
cmd/utils/flags.go
+11
-0
No files found.
cmd/ethereum/main.go
View file @
73d1ebe2
...
@@ -45,12 +45,10 @@ const (
...
@@ -45,12 +45,10 @@ const (
var
(
var
(
clilogger
=
logger
.
NewLogger
(
"CLI"
)
clilogger
=
logger
.
NewLogger
(
"CLI"
)
app
=
cli
.
NewApp
(
)
app
=
utils
.
NewApp
(
Version
,
"the go-ethereum command line interface"
)
)
)
func
init
()
{
func
init
()
{
app
.
Version
=
Version
app
.
Usage
=
"the go-ethereum command-line client"
app
.
Action
=
run
app
.
Action
=
run
app
.
HideVersion
=
true
// we have a command to print the version
app
.
HideVersion
=
true
// we have a command to print the version
app
.
Commands
=
[]
cli
.
Command
{
app
.
Commands
=
[]
cli
.
Command
{
...
@@ -107,8 +105,6 @@ runtime will execute the file and exit.
...
@@ -107,8 +105,6 @@ runtime will execute the file and exit.
Usage
:
`import a blockchain file`
,
Usage
:
`import a blockchain file`
,
},
},
}
}
app
.
Author
=
""
app
.
Email
=
""
app
.
Flags
=
[]
cli
.
Flag
{
app
.
Flags
=
[]
cli
.
Flag
{
utils
.
BootnodesFlag
,
utils
.
BootnodesFlag
,
utils
.
DataDirFlag
,
utils
.
DataDirFlag
,
...
...
cmd/utils/flags.go
View file @
73d1ebe2
...
@@ -19,6 +19,17 @@ import (
...
@@ -19,6 +19,17 @@ import (
"github.com/ethereum/go-ethereum/p2p/nat"
"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.
// These are all the command line flags we support.
// If you add to this list, please remember to include the
// If you add to this list, please remember to include the
// flag in the appropriate command definition.
// flag in the appropriate command definition.
...
...
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