Skip to content

support sub command  #21

Open
Open
@humboldt-xie

Description

@humboldt-xie

like docker
docker [OPTIONS] COMMAND

ex:
docker --debug run --it busybox

go:

type MyApp struct {
      Debug bool `flag:"debug"`
      CurCommand interface{} `flag:"&command"`
      Run  RunCmd `command:"run"`
      Build BuildCmd `command:"build"`
} 
type RunCmd struct {
       Interactive bool `flag:"i" help:"Keep STDIN open even if not attached"`
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions