Skip to content

Support --version flag #208

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

Merged
merged 1 commit into from
Jul 14, 2024
Merged

Support --version flag #208

merged 1 commit into from
Jul 14, 2024

Conversation

ymgyt
Copy link
Contributor

@ymgyt ymgyt commented Jul 13, 2024

I thought it would be convenient to display the version of bpf-linker, so I added support for the --version flag.

When you run bpf-linker --version (or -V), it displays:

bpf-linker 0.9.12

In this implementation, I ensured that when --help or --version is specified, the command returns a successful status code

Err(err) => match err.kind() {
ErrorKind::DisplayHelp | ErrorKind::DisplayVersion => {
print!("{err}");
return Ok(());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If an error were returned as is, it would display as:

Error: bpf-linker 0.9.12

Therefore, I made sure to return Ok instead.

@alessandrod alessandrod merged commit 6f4c969 into aya-rs:main Jul 14, 2024
10 checks passed
@alessandrod
Copy link
Collaborator

Thank you!

@ymgyt ymgyt deleted the version-flag branch July 14, 2024 02:03
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.

2 participants