These are chat archives for kbknapp/clap-rs

20th
Mar 2018
xliiv
@xliiv
Mar 20 2018 14:15
i'm using clap in my lib called fui
then i'm running crate_version! in fui here
after using fui in other project when i'm calling ohter-project -V i'm getting fui version (i'd expect the other project version)
xliiv
@xliiv
Mar 20 2018 20:25
using env::var("CARGO_PKG_VERSION") works like i expected
it's ok to me that is not compile time
xliiv
@xliiv
Mar 20 2018 20:39
should i crate a detailed issue or pass it?
Denis Lisov
@tanriol
Mar 20 2018 20:48
@xliiv I'm afraid that's inevitable :-( when fyi is being compiled, it does not know, what crate it will end up used in.
@xliiv And env::var likely won't work when you run the binary directly and not via cargo run
xliiv
@xliiv
Mar 20 2018 20:56
this makes sense about env::var + cargo, any other solution? @tanriol
Denis Lisov
@tanriol
Mar 20 2018 22:01
Apart from the obvious "just pass it from the project using your library"?