diff --git a/go/cmd/entrypoint/sub_cmd.go b/go/cmd/entrypoint/sub_cmd.go index a4617c7..b988b36 100644 --- a/go/cmd/entrypoint/sub_cmd.go +++ b/go/cmd/entrypoint/sub_cmd.go @@ -11,6 +11,7 @@ import ( "isle/jsonutil" "isle/toolkit" "os" + "slices" "strings" "dev.mediocregopher.com/mediocre-go-lib.git/mlog" @@ -221,7 +222,14 @@ func (ctx subCmdCtx) withParsedFlags( os.Exit(2) } - if err := ctx.flags.Parse(ctx.opts.args); err != nil { + parseArgs := ctx.opts.args + if opts.passthroughArgs { + if i := slices.Index(parseArgs, "--"); i >= 0 { + parseArgs, ctx.opts.args = parseArgs[:i], parseArgs[i+1:] + } + } + + if err := ctx.flags.Parse(parseArgs); err != nil { return ctx, err }