Is there a level to how many levels you can descend?
SimplySeth opened this issue · 3 comments
SimplySeth commented
In my code, I can only go down to the second level
i.e <script> gcp access
Desired outcome would be to do
<script> gcp access annotate or <script> ssh access list Basically all the `commoncmd/*` commands won't run of which annotate is one of them https://github.com/SimplySeth/cobrafailnirs commented
@SimplySeth your description is not clear.
- What is the expected behavior?
- What is the actual behavior?
- Can you show a short code example reproducing the issue? I guess we can see the issue in https://github.com/SimplySeth/cobrafail/ but it looks too big and complicated for an example of the issue
SimplySeth commented
Expected behavior
go run . gcp access annotate
should result in "annotate was run"
Actual behavior
go run . gcp access annotate
results in no output
Short code example
https://gist.github.com/SimplySeth/fb67b298ab3d45ee2135e4e4f41f31ce
go run . gcp *works
go run . gcp access *works
go run . ssh *works
go run . ssh access *works
SimplySeth commented
I needed to load the commands using the defined pointers ...
var (
GcpAccessCmd = *AccessCmd
SshAccessCmd = *AccessCmd
)
func init() {
GcpAccessCmd.AddCommand(&commoncmd.AccessGetCmd)
SshAccessCmd.AddCommand(&commoncmd.AccessGetCmd)
}