如何将标志作为urface / cli命令的参数传递?

I am using urfave/cli to build a CLI application in Go.

What I would like is options given after the first command to be treated as arguments and not flags (so that I can handle them myself or pass them to an other executable).

When using app.Action (see below), this is the behavior that I get, but if I am using cli.Commands then I get an error.

package main

import (
    "fmt"
    "github.com/urfave/cli"
    "log"
    "os"
)

func main() {
    app := cli.NewApp()

    app.Commands = []cli.Command{
        {
            Name:    "test",
            Action:  func(c *cli.Context) error {
                fmt.Println("test", c.Args())
                return nil
            },
        },
    }

    app.Action = func(c *cli.Context) error {
        fmt.Println(c.Args())
        return nil
    }

    err := app.Run(os.Args)
    if err != nil {
        log.Fatal(err)
    }
}

Output of: go run main.go cmd -f flag:

[cmd -f flag]

but go run main.go test cmd -f flag exits with an error where I would like it to oupput

test [cmd -f flag]

After looking at the documentation of cli.Command, there is actually a very simple way to have what I want: setting SkipFlagParsing to true will treat all flags as normal arguments.

app.Commands = []cli.Command{
    {
        Name:    "test",
        SkipFlagParsing: true
        Action:  func(c *cli.Context) error {
            fmt.Println("test", c.Args())
            return nil
        },
    },
}