-
Notifications
You must be signed in to change notification settings - Fork 703
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
refactor: use argp
library for parsing command line options and arguments
#1525
Conversation
…uments This commit changes the command line parsing code of `valkey-benchmark` to use the `argp` library (https://www.gnu.org/software/libc/manual/html_node/Argp.html), which is included in libc. This makes the options and arguments parsing more structured and easy to extend. Signed-off-by: Ricardo Dias <[email protected]>
a2b73d7
to
ac868bd
Compare
|
Shoot. I should have checked that before implementing this. I guess that's why the parsing was being done manually. |
e0082be
to
9513c43
Compare
Signed-off-by: Ricardo Dias <[email protected]>
9513c43
to
fb64423
Compare
Signed-off-by: Ricardo Dias <[email protected]>
f18a6d6
to
83d001c
Compare
To fix the problem of |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #1525 +/- ##
============================================
+ Coverage 70.83% 70.90% +0.06%
============================================
Files 120 120
Lines 64911 64999 +88
============================================
+ Hits 45982 46086 +104
+ Misses 18929 18913 -16
|
# GNU libc argp library needs to be installed with homebrew: | ||
# `brew install argp-standalone` | ||
FINAL_LIBS+= -largp | ||
FINAL_LDFLAGS+= -L/opt/homebrew/lib | ||
FINAL_CFLAGS+= -I/opt/homebrew/include |
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.
This requires all mac users to use homebrew to use the cli doesn't it, where it is working just fine today.
I guess I'm wondering is it really so important to remove our custom parsing logic?
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.
FWIW, I can't use homebrew on my company issued mac
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.
I guess it's not worth changing the custom parsing logic if it does not work in all platforms out of the box.
Closing this PR since |
This commit changes the command line parsing code of
valkey-benchmark
to use theargp
library (https://www.gnu.org/software/libc/manual/html_node/Argp.html), which is included in libc.This makes the options and arguments parsing more structured and easy to extend.