Skip to content

Conversation

@jofas
Copy link
Contributor

@jofas jofas commented Apr 11, 2025

Closes #60 by deleting the build script. This removes commit hash and source timestamp from the version string shown in the CLI and REPL.

xee/src/repl.rs Outdated
]);

println!("Xee XPath REPL {}", VERSION);
println!("Xee XPath REPL {}", clap::crate_version!());
Copy link
Contributor Author

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.

Copy link
Collaborator

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.

Copy link
Contributor Author

@jofas jofas Apr 11, 2025

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.

Copy link
Contributor Author

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?

Copy link
Collaborator

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.

@jofas jofas force-pushed the delete-xee-build-script branch from 207795f to ed675cb Compare April 11, 2025 17:16
@jofas jofas force-pushed the delete-xee-build-script branch from ed675cb to 93a4c2d Compare April 11, 2025 17:27
@faassen faassen merged commit c894786 into Paligo:main Apr 14, 2025
1 check passed
@github-actions github-actions bot mentioned this pull request Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support installation from crates.io

2 participants