-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
About subcommand directory #1059
Comments
Hi @fanux @jharshman , I am interested in this issue if that would be okay but I think I need to ask some clarification questions. Suppose that we are still discussing the example of creating a
Looking forward to hearing your thoughts! Thank you very much 🙂 |
For example,my app command line like this:
So I want generate codes:
If all create.go in cmd dir, it will failed, and mess... |
Other example:
|
@fanux
|
So I think only subcommand rely on parent command, can we regist subcommand in cmd/user/create.go? Set userCmd as public. So in cmd/user/create.go we can regist subcommand like this: UserCmd.AddCommand(createCmd), cmd/user.go no need import any more. |
I'm also interested in this capability. To model after the kubernetes style of |
This issue is being marked as stale due to a long period of inactivity |
I'm interested in this. In the meantime, I will try just creating separate files for each subcommand. |
Now that the cobra-cli has been moved to https://github.com/spf13/cobra-cli/ this issue should be migrated there. I'll let you so that you are subscribed and the OP. |
It looks like this issue has not been migrated by the OP or anyone as I can not find it in the cobra-cli repo. I'm interested in this feature, shall I copy this issue to cobra-cli myself? |
Yes please. Thank you. |
Copied in |
Thank you! |
cobra generates subcommand
user
in the same dir of its parent dir, it not very nice.If I add a command
user
this user command is notcreate
subcommand:So I think,
create
subcommand in a sub dir is better, like this:This will not conflict
The text was updated successfully, but these errors were encountered: