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
2407f006
Commit
2407f006
authored
Mar 10, 2015
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Godeps: bump github.com/codegangsta/cli
parent
0bb7377e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
11 deletions
+42
-11
Godeps.json
Godeps/Godeps.json
+2
-2
app.go
Godeps/_workspace/src/github.com/codegangsta/cli/app.go
+27
-4
app_test.go
Godeps/_workspace/src/github.com/codegangsta/cli/app_test.go
+3
-0
command.go
Godeps/_workspace/src/github.com/codegangsta/cli/command.go
+1
-1
help.go
Godeps/_workspace/src/github.com/codegangsta/cli/help.go
+9
-4
No files found.
Godeps/Godeps.json
View file @
2407f006
...
@@ -17,8 +17,8 @@
...
@@ -17,8 +17,8 @@
},
},
{
{
"ImportPath"
:
"github.com/codegangsta/cli"
,
"ImportPath"
:
"github.com/codegangsta/cli"
,
"Comment"
:
"1.2.0-
74-g50c77ec
"
,
"Comment"
:
"1.2.0-
81-g3e09053
"
,
"Rev"
:
"
50c77ecec0068c9aef9d90ae0fd0fdf410041da3
"
"Rev"
:
"
3e0905345cd2c5366530dbcdce62457f2ce16e7c
"
},
},
{
{
"ImportPath"
:
"github.com/ethereum/ethash"
,
"ImportPath"
:
"github.com/ethereum/ethash"
,
...
...
Godeps/_workspace/src/github.com/codegangsta/cli/app.go
View file @
2407f006
...
@@ -43,9 +43,11 @@ type App struct {
...
@@ -43,9 +43,11 @@ type App struct {
CommandNotFound
func
(
context
*
Context
,
command
string
)
CommandNotFound
func
(
context
*
Context
,
command
string
)
// Compilation date
// Compilation date
Compiled
time
.
Time
Compiled
time
.
Time
// Author
// List of all authors who contributed
Authors
[]
Author
// Name of Author (Note: Use App.Authors, this is deprecated)
Author
string
Author
string
//
Author e-mail
//
Email of Author (Note: Use App.Authors, this is deprecated)
Email
string
Email
string
// Writer writer to write output to
// Writer writer to write output to
Writer
io
.
Writer
Writer
io
.
Writer
...
@@ -70,14 +72,19 @@ func NewApp() *App {
...
@@ -70,14 +72,19 @@ func NewApp() *App {
BashComplete
:
DefaultAppComplete
,
BashComplete
:
DefaultAppComplete
,
Action
:
helpCommand
.
Action
,
Action
:
helpCommand
.
Action
,
Compiled
:
compileTime
(),
Compiled
:
compileTime
(),
Author
:
"Author"
,
Author
:
"Dr. James"
,
Email
:
"unknown@email"
,
Email
:
"who@gmail.com"
,
Authors
:
[]
Author
{{
"Jim"
,
"jim@corporate.com"
},
{
"Hank"
,
"hank@indiepalace.com"
}},
Writer
:
os
.
Stdout
,
Writer
:
os
.
Stdout
,
}
}
}
}
// Entry point to the cli app. Parses the arguments slice and routes to the proper flag/args combination
// Entry point to the cli app. Parses the arguments slice and routes to the proper flag/args combination
func
(
a
*
App
)
Run
(
arguments
[]
string
)
(
err
error
)
{
func
(
a
*
App
)
Run
(
arguments
[]
string
)
(
err
error
)
{
if
a
.
Author
!=
""
&&
a
.
Author
!=
""
{
a
.
Authors
=
append
(
a
.
Authors
,
Author
{
a
.
Author
,
a
.
Email
})
}
if
HelpPrinter
==
nil
{
if
HelpPrinter
==
nil
{
defer
func
()
{
defer
func
()
{
HelpPrinter
=
nil
HelpPrinter
=
nil
...
@@ -294,3 +301,19 @@ func (a *App) appendFlag(flag Flag) {
...
@@ -294,3 +301,19 @@ func (a *App) appendFlag(flag Flag) {
a
.
Flags
=
append
(
a
.
Flags
,
flag
)
a
.
Flags
=
append
(
a
.
Flags
,
flag
)
}
}
}
}
// Author represents someone who has contributed to a cli project.
type
Author
struct
{
Name
string
// The Authors name
Email
string
// The Authors email
}
// String makes Author comply to the Stringer interface, to allow an easy print in the templating process
func
(
a
Author
)
String
()
string
{
e
:=
""
if
a
.
Email
!=
""
{
e
=
"<"
+
a
.
Email
+
"> "
}
return
fmt
.
Sprintf
(
"%v %v"
,
a
.
Name
,
e
)
}
Godeps/_workspace/src/github.com/codegangsta/cli/app_test.go
View file @
2407f006
...
@@ -21,6 +21,9 @@ func ExampleApp() {
...
@@ -21,6 +21,9 @@ func ExampleApp() {
app
.
Action
=
func
(
c
*
cli
.
Context
)
{
app
.
Action
=
func
(
c
*
cli
.
Context
)
{
fmt
.
Printf
(
"Hello %v
\n
"
,
c
.
String
(
"name"
))
fmt
.
Printf
(
"Hello %v
\n
"
,
c
.
String
(
"name"
))
}
}
app
.
Author
=
"Harrison"
app
.
Email
=
"harrison@lolwut.com"
app
.
Authors
=
[]
cli
.
Author
{{
"Oliver Allen"
,
"oliver@toyshop.com"
}}
app
.
Run
(
os
.
Args
)
app
.
Run
(
os
.
Args
)
// Output:
// Output:
// Hello Jeremy
// Hello Jeremy
...
...
Godeps/_workspace/src/github.com/codegangsta/cli/command.go
View file @
2407f006
...
@@ -119,7 +119,7 @@ func (c Command) Run(ctx *Context) error {
...
@@ -119,7 +119,7 @@ func (c Command) Run(ctx *Context) error {
// Returns true if Command.Name or Command.ShortName matches given name
// Returns true if Command.Name or Command.ShortName matches given name
func
(
c
Command
)
HasName
(
name
string
)
bool
{
func
(
c
Command
)
HasName
(
name
string
)
bool
{
return
c
.
Name
==
name
||
c
.
ShortName
==
name
return
c
.
Name
==
name
||
(
c
.
ShortName
!=
""
&&
c
.
ShortName
==
name
)
}
}
func
(
c
Command
)
startApp
(
ctx
*
Context
)
error
{
func
(
c
Command
)
startApp
(
ctx
*
Context
)
error
{
...
...
Godeps/_workspace/src/github.com/codegangsta/cli/help.go
View file @
2407f006
...
@@ -12,11 +12,10 @@ USAGE:
...
@@ -12,11 +12,10 @@ USAGE:
{{.Name}} {{if .Flags}}[global options] {{end}}command{{if .Flags}} [command options]{{end}} [arguments...]
{{.Name}} {{if .Flags}}[global options] {{end}}command{{if .Flags}} [command options]{{end}} [arguments...]
VERSION:
VERSION:
{{.Version}}
{{if or .Author .Email}}
{{.Version}}
AUTHOR:{{if .Author}}
AUTHOR(S):
{{.Author}}{{if .Email}} - <{{.Email}}>{{end}}{{else}}
{{range .Authors}}{{ . }} {{end}}
{{.Email}}{{end}}{{end}}
COMMANDS:
COMMANDS:
{{range .Commands}}{{.Name}}{{with .ShortName}}, {{.}}{{end}}{{ "\t" }}{{.Usage}}
{{range .Commands}}{{.Name}}{{with .ShortName}}, {{.}}{{end}}{{ "\t" }}{{.Usage}}
...
@@ -112,6 +111,12 @@ func DefaultAppComplete(c *Context) {
...
@@ -112,6 +111,12 @@ func DefaultAppComplete(c *Context) {
// Prints help for the given command
// Prints help for the given command
func
ShowCommandHelp
(
c
*
Context
,
command
string
)
{
func
ShowCommandHelp
(
c
*
Context
,
command
string
)
{
// show the subcommand help for a command with subcommands
if
command
==
""
{
HelpPrinter
(
SubcommandHelpTemplate
,
c
.
App
)
return
}
for
_
,
c
:=
range
c
.
App
.
Commands
{
for
_
,
c
:=
range
c
.
App
.
Commands
{
if
c
.
HasName
(
command
)
{
if
c
.
HasName
(
command
)
{
HelpPrinter
(
CommandHelpTemplate
,
c
)
HelpPrinter
(
CommandHelpTemplate
,
c
)
...
...
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