Can not parse arguments while running a program

I am using xlsx2csv to convert an xlsx file to csv file.

When I install the said package using

cargo install xlsx2csv

and than run following command to convert Book1.xlsx file first sheet as sheet1.csv. It runs perfectly fine:

xlsx2cvs Book1.xlsx sheet1.csv

On the other hand, i downloaded the source code and run the same command like:

Cargo run Book1.xlsx sheet1.csv it gives following error:

thread 'main' panicked at 'Command xlsx2csv: Argument or group 'use_sheet_names' specified in 'conflicts_with*' for 'list' does not exist', /Users/syedkamran/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap-3.2.25/src/builder/debug_asserts.rs:237:13
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace.

The bahaviour is quit strange, since the same program runs while I installed it but it does not run when I try to run it from the source code.

Cargo.toml contains this which means it is okay to accept any crate for as long as major version matches and there's no Cargo.lock to specify otherwise.

[dependencies]
clap = { version = "3", features = ["derive"] }
csv = "1"
ooxml = "0.2.5"
pbr = "1"
regex = "1"

Maybe this was working fine as of a year ago but not anymore.

Try adding this lock file to the repo, it might work better.

(Cargo.toml is not a problem, lack of Cargo.lock is)

1 Like

Which implies clap technically broke back-compat... I wouldn't expect that, Rust libraries are generally quite good about semver!

It's also possible they fail in debug mode and the library only tested in release, I suppose.

1 Like

I imagine this is a bugfix that made it reject an invalid config that was previously incorrectly accepted.

Always a hard line to walk - you're never completely back compatible, and churning through major versions isn't all that great either, but cases like this show the downside of "that was a bug".

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.