Skip to content
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

Update clap to 4.4 #322

Merged
merged 7 commits into from
Dec 1, 2023
Merged

Conversation

patrickelectric
Copy link
Member

@patrickelectric patrickelectric commented Dec 1, 2023

Helps #321

It appears that it did not fix the problem, this PR address the issue using the new configuration on clap 4.4 default_missing_value

Signed-off-by: Patrick José Pereira <[email protected]>
Signed-off-by: Patrick José Pereira <[email protected]>
@patrickelectric patrickelectric changed the title cargo: Update clap to 4.4 Update clap to 4.4 Dec 1, 2023
@joaoantoniocardoso
Copy link
Collaborator

Closes #122

@joaoantoniocardoso joaoantoniocardoso linked an issue Dec 1, 2023 that may be closed by this pull request
@joaoantoniocardoso joaoantoniocardoso self-requested a review December 1, 2023 15:09
Copy link
Collaborator

@joaoantoniocardoso joaoantoniocardoso left a comment

Choose a reason for hiding this comment

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

image

I don't know why, but somehow it is defining the wrong possible values

Copy link
Collaborator

@joaoantoniocardoso joaoantoniocardoso left a comment

Choose a reason for hiding this comment

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

image

Failing for --gst-feature-rank omxh264enc=0,v4l2h264enc=250,x264enc=260

@patrickelectric patrickelectric force-pushed the update-clap branch 2 times, most recently from 253574a to d038fa2 Compare December 1, 2023 16:15
@joaoantoniocardoso
Copy link
Collaborator

joaoantoniocardoso commented Dec 1, 2023

image

Failing for --gst-feature-rank omxh264enc=0,v4l2h264enc=250,x264enc=260

The parser needs to return the value. Fix:

fn gst_feature_rank_validator(val: &str) -> Result<String, String> {
    if let Some((_key, value_str)) = val.split_once('=') {
        if value_str.parse::<i32>().is_err() {
            return Err("GST_RANK_INT_VALUE should be a valid 32 bits signed integer, like \"-1\", \"0\" or \"256\" (without quotes).".to_string());
        }
    } else {
        return Err("Unexpected format, it should be <GST_PLUGIN_NAME>=<GST_RANK_INT_VALUE>, where GST_PLUGIN_NAME is a string, and GST_RANK_INT_VALUE a valid 32 bits signed integer. Example: \"omxh264enc=264\" (without quotes).".to_string());
    }
    Ok(val.into())
}

Copy link
Collaborator

@joaoantoniocardoso joaoantoniocardoso left a comment

Choose a reason for hiding this comment

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

Well done, thanks!!

@patrickelectric
Copy link
Member Author

Thanks for the review!

patrickelectric and others added 5 commits December 1, 2023 13:46
Signed-off-by: Patrick José Pereira <[email protected]>
Co-authored-by: João Antonio Cardoso <[email protected]>
Signed-off-by: Patrick José Pereira <[email protected]>
Signed-off-by: Patrick José Pereira <[email protected]>
Signed-off-by: Patrick José Pereira <[email protected]>
@patrickelectric patrickelectric merged commit 1fa4638 into mavlink:master Dec 1, 2023
3 checks passed
@patrickelectric patrickelectric deleted the update-clap branch December 1, 2023 16:52
@patrickelectric patrickelectric restored the update-clap branch July 29, 2024 18:58
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.

Update Clap and move to clap derive
2 participants