зеркало из https://github.com/mislav/hub.git
Print subcommand lookup errors.
This commit is contained in:
Родитель
df13d0125e
Коммит
439a0dbe17
|
@ -31,6 +31,7 @@ type Command struct {
|
|||
func (c *Command) Call(args *Args) (err error) {
|
||||
runCommand, err := lookupCommand(c, args)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -90,7 +91,6 @@ func (c *Command) subCommandsUsage() string {
|
|||
key = printUsageBuffer(s, buffer, key)
|
||||
}
|
||||
}
|
||||
buffer.WriteString("\n")
|
||||
|
||||
return buffer.String()
|
||||
}
|
||||
|
|
|
@ -90,7 +90,6 @@ func TestCommandUsageSubCommands(t *testing.T) {
|
|||
|
||||
expected := `usage: git foo
|
||||
or: git foo bar
|
||||
|
||||
`
|
||||
assert.Equal(t, expected, usage)
|
||||
}
|
||||
|
@ -105,7 +104,6 @@ func TestCommandUsageSubCommandsPrintOnlyRunnables(t *testing.T) {
|
|||
usage := c.subCommandsUsage()
|
||||
|
||||
expected := `usage: git foo bar
|
||||
|
||||
`
|
||||
assert.Equal(t, expected, usage)
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче