Add end-to-end smoke driving the real CLI against the containerized fake

This commit is contained in:
2026-08-29 06:58:35 -05:00
parent d98f0aeb93
commit bbd85fae71
4 changed files with 211 additions and 12 deletions
+14
View File
@@ -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)