[Virtio-fs] [virtiofsd-rs] MR opened: Refactor arg parsing code

virtiofs-bot at sinrega.org virtiofs-bot at sinrega.org
Fri Apr 9 05:29:33 UTC 2021


This merge request switches the option parser from `clap` to `structopt`.
This reduces a considerable amt. of duplicate code & improves readability.

Internally `structopt` uses `clap` but provides a nice way to define arg parsing in a declarative way. It also re-exports `clap`.
In the next upcoming major version of `clap`, support for the same will be added to the crate itself with the same syntax, except that `#[derive(Structopt)]` will change to `#[derive(Clap)]`. [1] <br>
Also, beta version of clap-v3 is available for testing. [2]

[1] https://github.com/poma/clap#how-does-clap-compare-to-structopt <br>
[2] https://crates.io/crates/clap-v3

Signed-off-by: Mihir Luthra luthramihir708 at gmail.com
---
https://gitlab.com/virtio-fs/virtiofsd-rs/-/merge_requests/17




More information about the Virtio-fs mailing list