-
Notifications
You must be signed in to change notification settings - Fork 904
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
driver: replace getopt with cxxopts, replace -B, clean up help #4616
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I've sorted the options into help groups. Bit iffy on the developer vs logging side. Current help string output:
EDIT: updated to match latest commit |
Closed
povik
reviewed
Sep 26, 2024
povik
reviewed
Sep 26, 2024
c8c82cb
to
575415a
Compare
Please switch to https link for submodule, could create issues later if not |
dang, ok |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements #4580.
In this PR I'm adding the cxxopts header-only library as a submodule. This allows me to introduce long option aliases such as
--quiet
for-q
. Since-B
was undocummented and is assumed not broadly used, I'm replacing it with--perffile
. Behaviour of--
is retained as implemented in #3973. The behavior ofyosys -help
being special cased not to be equivalent toyosys -h -e -l -p
is also retained. Help string indentation isn't retained since we're letting cxxopts generate it. Argument names likelogfile
are converted for consistency into<logfile>
which is then used as is broadly the POSIX/GNU convention. Long options don't have to match the first letter of the short option if it's more logical that way, for example,-m
is--plugin
, I also changed the help string toload the specified <plugin> module
since it was colliding with the concept of the HDL top module. The HDL top module selection option is now-r
and--top
and its help iselaborate the specified HDL <top> module
. There's more minor differences in wordingThe error reporting the usage of an unimplemented option such as
-z
now mentions that option. Before:Run 'yosys -h' for help.
After:From this PR onward, it should decision whether a flag gets to hog the top level namespace since we now have an alternative. On the other hand, it should make it easier to experiment by adding long-only options.