Skip to content

Ability to add nested commands through cobra add #266

Closed
@ianwalter

Description

@ianwalter

I would love to use cobra add to create nested commands, for example:

cobra add db migrate

Cobra would then see that there are multiple arguments, create a directory called db if it doesn't exist and a command file inside of it called migrate.go. It would also create another file either inside of db or at the same directory level called db.go or root.go that will simply create a dbCommand so that nested commands can be added to it. I can submit a PR for this after my existing PR is resolved. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cobra-commandCore `cobra.Command` implementationskind/featureA feature request for cobra; new or enhanced behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions