Get the latest tech news
Rust CLI with Clap
Using rust types to specify command line interfaces using the clap crate
Regardless of the reasons, I feel that there is tremendous value for both the developer and user which can arise from interacting with the command line via the sort of strict contract that rust's type system enables. There are tons of other great features in clap that can be found in the docs, but rather than get into the specifics of this crate, I want to discuss how type-driven design can elevate command line interfaces to be on equal footing with published libraries and service APIs. This helps new developers on a project to understand a codebase and also assists maintainers down the road when they need to add new features, as there is a single entry point from which they can start designing their changes.
Or read this on Hacker News