You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main objective was to simplify the main.rs file. It currently holds all the code for the options which I found very overwhelming when trying to make some changes. Then while going through it I thought if there would be a more condensed way to express the options and came across clap. I also saw in some past issues that there was some interest to use it and thus decided I could give it a try.
The changes in other files (in discovery, playback,...) were to reshape some of the elements to be used with clap more harmoniously. For example: Changing the MIXERS from a const array into an enum so that the the variants are shown as "possible values". Some of these changes, in my opinion, are also beneficial on their own accord. Using the same example: With MIXERS being an enum, it no longer needs the code to iterate and find the mixer that was set in the options. Also there is no need for any of the mixers to have an extra separate impl just to associate a name. Also it helps using the types that are already enums like DeviceType by just deriving ValueEnum. On these we are also spared the hand made impl of FromStr.
Overall, I just think the clap derive way of doing options just looks cleaner and more accessible.
This file contains hidden or 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
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.
Changes to move from opt into clap cli
Done:
TODO:
I will continue to work on approximating this solution as close as possible to the previous cli flow.
Mean while I would love to get some comments.