-
Notifications
You must be signed in to change notification settings - Fork 151
Add "--version" option to the usbguard CLI #576
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
7a95143 to
b2a3ef3
Compare
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.
Hi @Cropi,
I had a quick look through the changes and also inspected the output locally:
# ./usbguard --version
usbguard 1.1.2 compiled with:
Platform: x86_64-pc-linux-gnu
Platform (lsb_release -d) Description: Gentoo Linux
Linux audit support: 1
Libcapng support: 1
Seccomp support: 1
Crypto backend library: libsodiumBased on what I saw I would like to feedback the following:
-
I like the idea of including some additional information to ease reporting.
At least we can ask for that output from users running a recent enough version. -
Currently, all of that information included is gathered at compile time.
For two of those, that could be trouble:- "Platform"
- "Platform (lsb_release -d)"
I suggest to drop these two because of risk of being out of sync with the running
machine and because gathering them live from C++ code is probably more code
and effort than healthy here. Also, theyes can be asked for rather easily. -
The
Description:part from output oflsb_release -dlooks out of place and unintended. -
The new code roughly follows pattern
if foo_enabled: print("foo: 1").
The problem here is that:- Absence is not communicated, there will be no line
foo: 0for absent features. That's rather unpractical. - A constant value of 1 does not seem to offer much value.
I would like to suggest adding#elsebranches and to go to humanenabled
anddisabledor similar.
- Absence is not communicated, there will be no line
-
The use of tabs in the output seems well intended but does not feel "organic".
I suggest use of only two spaces rather than tabs for a more "human" feel. -
Adding two new files for the new functions seems overkill, given that the new code could live right next to sibling function
showTopLevelHelpin filesrc/CLI/usbguard.cpp. -
Bash completion at
scripts/bash_completion/usbguardshould probably learn about--versionas well.
What do you think?
Best, Sebastian
|
Hi Sebastian,
I am fine either way. I saw these in another open source project, rsyslog , that's why I thought we could give it a try.
I agree.
I agree.
Seems good to me.
I wonder if there is anything else we could include in the output. Maybe if you build usbguard from sources, then the last commit ID could be mentioned as well. |
@Cropi sounds good! It's a classic way to break the build for release tarballs without a |
Running usbguard --version should help us handle fixes and issues more easily in the future. By doing so, it's easier to track down which options have been enabled during build time. Fixes USBGuard#570
Running
usbguard --versionshould help us handle fixes and issues more easily in the future. By doing so, it's easier to track down which options have been enabled during build time. Fixes #570Any suggestions on what else to display are welcomed.