-
Notifications
You must be signed in to change notification settings - Fork 126
Open
Description
This is transfer of @fanux's spf13/cobra#1059 as suggested there by @johnSchnake
➜ app cobra add create
create created at /Users/fanux/work/src/app/cmd/create.go
➜ app cobra add user -p create
user created at /Users/fanux/work/src/app/cmd/user.go
➜ app tree
.
├── LICENSE
├── cmd
│ ├── create.go
│ ├── root.go
│ └── user.go
└── main.go
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 not create subcommand:
cobra add user
Error: /Users/fanux/work/src/app/cmd/user.go already exists
So I think, create subcommand in a sub dir is better, like this:
.
├── LICENSE
├── cmd
│ ├── create.go
│ ├── root.go
| |---create
│ └── user.go
└── main.go
This will not conflict
adriensadriensadriens
Metadata
Metadata
Assignees
Labels
No labels