Delightful command-line utilities with Rust

Опубликовано: 17 Апрель 2026
на канале: timClicks
7,640
167

The clap crate has an excellent set of tutorials. But they can intimidatingly long and there isn't a lot of guidance when things go wrong. This video walks you through clap's features while explaining some of the concepts.


📚 Resources:
Tutorial: https://docs.rs/clap/latest/clap/_der...

Highlights

Introducing the dbg! macro 03:30
Getting myself out of a confusing error message when I incorrectly specify arg 04:10
Where is the author in the help template? 06:30
Detailing the Command proc macro 9:10
Explaining what the "builder pattern" is 11:12
Coolean cameo 18:50
Debugging an unexpected panic 25:43

Timeline

00:00 Welcome
00:44 Project setup
01:47 Quick start
10:40 Specify info via Cargo.toml
11:12 What the "builder pattern" is
12:24 Propositional arguments
14:40 Custom actions for arguments
17:27 Named arguments
18:38 Flags
19:49 Sub-commands
21:42 Default values
23:40 Validation
29:32 Custom argument parsers
31:25 Argument groups
38:05 Testing clap
45:05 Wrap up



🦀 Rust resources:
Tim's tutorial videos https://timclicks.dev
Rust Documentation: https://doc.rust-lang.org/book/
Rust Playground: https://play.rust-lang.org/
Rust in Action (Tim's book!) https://mng.bz/4MlD
How to Learn Rust (online course!) https://learning.accelerant.dev/how-t...

👋 Connect with Tim:
Twitter:   / timclicks  
GitHub: https://github.com/timClicks
Mastodon: https://mastodon.nz/@timClicks
DEV: https://dev.to/timclicks/
Patreon (extra learning materials)   / timclicks  


🔔 Subscribe to the channel and click the bell icon to stay updated with the latest videos and live streams from timClicks: https://www.youtube.com/timClicks?sub...

👍 Like this video if you found it helpful, and share it with your friends who are also interested in Rust programming.