Skip to content

Conversation

varun-doshi
Copy link

Fixes #689

@jan-ferdinand
Copy link
Member

I think the same thing can be achieved by (see also):

#[derive(Debug, Clone, Parser)]
+ #[command(version)]
enum Command { /* … */ }

It might also be worth it to do some build.rs + git magic (like this in combination with this). This way, a version looks like x.y.z if there are no modifications since the last release, and otherwise x.y.z+n-gdeadbeef, which allows developers to identify the exact version in any case.

Those are just my 2 cents; whether the additional logic is worth is should be discussed, first.

@varun-doshi
Copy link
Author

varun-doshi commented Oct 14, 2025

I think the same thing can be achieved by (see also):

#[derive(Debug, Clone, Parser)]
+ #[command(version)]
enum Command { /* … */ }

It might also be worth it to do some build.rs + git magic (like this in combination with this). This way, a version looks like x.y.z if there are no modifications since the last release, and otherwise x.y.z+n-gdeadbeef, which allows developers to identify the exact version in any case.

Those are just my 2 cents; whether the additional logic is worth is should be discussed, first.

Yes this makes sense
We can also use vergen to get an output like this neptune-core/v0.0.1-892ad575/linux-x86_64/rustc1.85.0

Will proceed with whichever is advised

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.

Add CLI Command: version

2 participants