-
Notifications
You must be signed in to change notification settings - Fork 28
Removed build script from xee #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
xee/src/repl.rs
Outdated
| ]); | ||
|
|
||
| println!("Xee XPath REPL {}", VERSION); | ||
| println!("Xee XPath REPL {}", clap::crate_version!()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I'm seeing this in the diff, I might've been a bit overeager in removing VERSION completely. Maybe a
pub(crate) const VERSION: &str = clap::crate_version!();would have been better than removing the constant completely and calling clap::crate_version inline here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am trying to remember whether clap has a builtin version feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is! CommandFactory is implemented by #[derive(Parser)]. We can use this to retrieve the version via Command::get_version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the change in 93a4c2d. It's a lot better than crate_version!(). I'm a bit confused about the layout of clap-related structures though. I thought structs in a Subcommand variants could only derive Args, not be full blown Parsers themselves. Was this a conscious design decision?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I doubt it was a conscious design decision.
207795f to
ed675cb
Compare
ed675cb to
93a4c2d
Compare
Closes #60 by deleting the build script. This removes commit hash and source timestamp from the version string shown in the CLI and REPL.