Add end-to-end smoke driving the real CLI against the containerized fake
This commit is contained in:
@@ -53,6 +53,20 @@ func Run(args []string, stdout, stderr io.Writer) int {
|
||||
fmt.Fprint(stderr, usage)
|
||||
return 1
|
||||
}
|
||||
// Hoist a leading global --config PATH onto the subcommand (the
|
||||
// subcommand flag sets already accept it anywhere).
|
||||
var hoisted []string
|
||||
for len(args) >= 2 && (args[0] == "--config" || args[0] == "-config") {
|
||||
hoisted = append(hoisted, args[0], args[1])
|
||||
args = args[2:]
|
||||
}
|
||||
if len(hoisted) > 0 {
|
||||
if len(args) == 0 {
|
||||
fmt.Fprint(stderr, usage)
|
||||
return 1
|
||||
}
|
||||
args = append(args, hoisted...)
|
||||
}
|
||||
switch args[0] {
|
||||
case "help", "-h", "--help":
|
||||
fmt.Fprint(stdout, usage)
|
||||
|
||||
Reference in New Issue
Block a user