Delightful command-line utilities with Rust

Ғылым және технология

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: 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 timclicks.dev
- Rust Documentation: doc.rust-lang.org/book/
- Rust Playground: play.rust-lang.org/
- Rust in Action (Tim's book!) mng.bz/4MlD
- How to Learn Rust (online course!) learning.accelerant.dev/how-t...
👋 Connect with Tim:
- Twitter: / timclicks
- GitHub: github.com/timClicks
- Mastodon: mastodon.nz/@timClicks
- DEV: 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: kzread.info?sub...
👍 Like this video if you found it helpful, and share it with your friends who are also interested in Rust programming.

Пікірлер: 7

  • @gergelypaless5042
    @gergelypaless504210 ай бұрын

    A clap is well deserved for this crate

  • @timClicks

    @timClicks

    10 ай бұрын

    I applaud your dedication to puns

  • @abhilekhgautam5963
    @abhilekhgautam596310 ай бұрын

    thank you for this. Need more of this kind.

  • @timClicks

    @timClicks

    10 ай бұрын

    I am glad that you enjoyed the video. Let me know if there are other projects that you think I should explain :)

  • @Comradin
    @Comradin10 ай бұрын

    I like the idea of presenting a longer video about a special problem domain like cli apps. With the depreciation of the rusoto crate and the aws rust sdk being a new kid on the block, could you make a video about the aws rust sdk and how to use it?

  • @timClicks

    @timClicks

    10 ай бұрын

    The AWS SDK for Rust is very extensive, but there are definitely common patterns across services. I'll add this to my ideas list.

  • @pwnwriter
    @pwnwriter10 ай бұрын

    Can we pass a user defined function in ABOUT attribute?

Келесі