tmkontra / stoichkit

a toolkit for stoichiometry
https://crates.io/crates/stoichkit
MIT License
9 stars 1 forks source link

error: Found argument ... which wasn't expected, or isn't valid in this context #13

Open Syrov-Egor opened 11 months ago

Syrov-Egor commented 11 months ago

Hi!

It seems that every time I try to calculate anything using any of the sub-commands, for example: .../stoichkit/target/release$ ./stoichkit balance H2O+O2 = H2O2 or .../stoichkit/target/release$ ./stoichkit theoretical-yield "2H2O2" 4.0 = "2H2O" O2

I always get the same error: error: Found argument '=' which wasn't expected, or isn't valid in this context

(or other argument, like 'O2' or '0.5')

However, the toolkit has compiled properly and --V or --help options are working.

Am I missing something?

Crate has been compiled on Ubuntu 22.04.3 with rustc 1.74.0 (79e9716c9 2023-11-13)

tmkontra commented 10 months ago

Hi @Syrov-Egor thanks for using stoichkit! Sorry it's not working quite right.

I just compiled v0.6.1 on Fedora 38, and I am able to run the commands you shared:

(note the balance command does not use the + operator, it accepts a list of space delimited formulas)

[8:41:54] tmck:stoichkit git:(0.6.0*) $ ./target/release/stoichkit balance H2O O2 = H2O2 
2*H2O + O2 = 2*H2O2
[8:39:49] tmck:stoichkit git:(0.6.0*) $ ./target/release/stoichkit theoretical-yield "2*H2O2" 4.0 = "2*H2O" O2 
H2O 2.1185393 g
O2 1.8814605 g
Syrov-Egor commented 10 months ago

Strangely enough, I was able to run the "balance" function with quotation marks (passing it as a string value, I suppose), while I still cannot run "theoretical-yield" function. It seems like command line argument parsing works somehow differently on different platforms... 2023-12-15 104501

tmkontra commented 10 months ago

It seems like command line argument parsing works somehow differently on different platforms...

Yes I think you're right. Could you share which shell you are using?

Syrov-Egor commented 10 months ago

Shell: bash 5.1.16