Update `dsc --version` to include build info
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 523
- Forks
- 75
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 24
Description
Summary of the new feature / enhancement
Currently, the dsc --version command is only able to emit the cargo package version of the CLI, without any other useful information. However, especially prior to the 3.0.0 release (neither alpha nor preview), people may often be building from source, and it would in general be useful to have the extended information available from clap and the build, like the branch, commit hash, rust version, etc.
For example, it could emit something like:
dsc --version
dsc 3.0.0-preview.7
branch:main
commit_hash:ef36815
build_time:2024-04-10 09:28:05 -05:00
build_env:rustc 1.76.0 (07dca489a 2024-02-04),stable-x86_64-pc-windows-msvc
We could then have users paste this output in their bug reports.
Alternatively, it would be useful to be able to record this information (and possibly other info?) with a separate command, like dsc info - both so the output could use the normal command data formatting and users could upload YAML for the reporting, and we could keep the short version information that people likely want to see without the distracting/confusing (to them) build information. We could extend an info command to include other information as needed, like the meta configuration state.
Proposed technical implementation details (optional)
I found a blog post using shadow-rs that demonstrates adding build information to a CLI built with clap in rust. I think following those steps and either extending the version command or creating a new command would be useful for bug reporting and ensuring that we're discussing the same code.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the existing dsc --version command and reviewing the linked shadow-rs approach. Decide whether the build metadata belongs in version output or a new dsc info command; done means the chosen command reports the requested build details consistently for bug reports.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100