DEV Community

Molly Crendraven
Molly Crendraven

Posted on

Nested subcommands in Rest with clap

I apologize for the brief post, but it's late and I spent too much time figuring this out to not share. Hope it helps someone!

Edit: I have no ideas why repl.it won't find the traits and compile. I swear it works in real life. Suggestions for fixing the example are welcome!

Top comments (1)

Collapse
 
wemgl profile image
Wembley Leach

I found an example using the latest version of clap in their docs. Here's the link for anyone else that might come across this issue:

github.com/clap-rs/clap/blob/3ef78...

In particular, the stash subcommand is a great example of a nested command.

Also, great post Drazi! Without your solution I wouldn't have found an "official" one directly from clap.