Replies: 1 comment 4 replies
-
I think I'll switch to a hashmap with the enums as keys and the API endpoint URL as the value. Like a dispatch table. Not really related to clap I know, but curious to what others are doing here. Thanks for listening :) |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
Very new to Rust and clap. What design pattern should I reach for to make this smaller and move out of my main?
https://github.com/ghenry/CallSwitchOne-CLI/blob/0fa1d90b4c65a94d86772f4c8e10d33659576dc7/src/main.rs#L33
I'll be mapping a lot of commands, subcommands and args to these API endpoints:
https://www.callswitchone.com/api-docs/
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions