Remove old cli framework.

Also consolidate the leftover packages under cli.
Remove pkg/mflag.
Make manpage generation work with new cobra layout.
Remove remaining mflag and fix tests after rebase with master.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 14712f9ff0d20a3b64a60103608b8cc998909242
Component: engine
This commit is contained in:
Daniel Nephin
2016-06-23 11:25:51 -04:00
parent 9d7fdddb73
commit e263ef28d9
22 changed files with 116 additions and 2279 deletions

View File

@ -1,6 +1,9 @@
package cli
import "strings"
import (
"fmt"
"strings"
)
// Errors is a list of errors.
// Useful in a loop if you don't want to return the error right away and you want to display after the loop,
@ -18,3 +21,13 @@ func (errList Errors) Error() string {
}
return strings.Join(out, ", ")
}
// StatusError reports an unsuccessful exit by a command.
type StatusError struct {
Status string
StatusCode int
}
func (e StatusError) Error() string {
return fmt.Sprintf("Status: %s, Code: %d", e.Status, e.StatusCode)
}