Add "Cli style" relative path to a pathbuf

⚓ rust    📅 2025-07-16    👤 surdeus    👁️ 1      

surdeus

I'm doing a cli app using clap that require a path as an input. Except, this path can be both absolute and relative.

Having an absolute path is fine, and having an "extending" relative path (ex: "images/cats") is easy to deal with, but I cannot find anything to deal with paths that go to the parent directory (ex: "../images/cats").

Is there any sneaky method I can use? Or crate?

6 posts - 3 participants

Read full topic

🏷️ rust_feed