this post was submitted on 10 Oct 2025
83 points (96.6% liked)

Programming

23580 readers
52 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
83
Software Quality Collapse (techtrenches.substack.com)
submitted 1 month ago* (last edited 1 month ago) by HaraldvonBlauzahn@feddit.org to c/programming@programming.dev
you are viewing a single comment's thread
view the rest of the comments
[–] thingsiplay@beehaw.org 1 points 1 month ago* (last edited 1 month ago) (1 children)

Right now I am working on a Rust cli tool with clap and have no issues with the LSP in Neovim. It might be a configuration error. Clap is used by many and is the defacto standard cli parser in Rust. As a fan of argparse in Python, I think clap is even better. argparse being implemented as standard library is the biggest pro over clap. I wouldn't even use getops anymore, unless it is a Bash script. And even so, Bash has its own builtin argument parser that I use for scripts.

If you really wanted to try Rust, you should sort of that issue. Clap works great and lot of users use it. Who knows, you may even end up liking it and Rust.

Edit: BTW which example do you refer to exactly? I looked at the official ones and couldn't find: https://doc.rust-lang.org/stable/rust-by-example/

[–] MonkderVierte@lemmy.zip 2 points 1 month ago (1 children)

Thanks. Yeah, i'll try again. The (Rust-)tooling is already selected for the bigger project anyway.

It's from https://docs.rs/clap/latest/clap/ the features --derive .

[–] thingsiplay@beehaw.org 1 points 1 month ago* (last edited 1 month ago)

I explicitly only use it with features --derive. It let's you write the cli option setup as a struct, which feels super natural to me. That's why I know for a fact it works well. Look in your Cargo.toml under the section [dependencies] there should be an entry for clap: clap = { version = "4.5.41", features = ["derive"] } is mine. Right now version 4.5.48 is the newest I think.

Also from your previous reply, what do you mean "unless i do the implied version, but then it can’t derive features"? I don't know why you shouldn't be able to use derive. I'm no expert either BTW, just wondering what went wrong.

Edit: typo