Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the UEFI command-line parsing and help output to align with newer CLI options and fix several typos/mismatched messages in the Framework tool.
Changes:
- Fix/standardize option names and messages (e.g.,
--autofanctrl,--ps2-enable,--ec-hib-delay,--device,--test-retimer,--pd-disableassignment). - Add UEFI parsing for
--remap-key <ROW> <COL> <SCANCODE>and ensure some options correctly markfound_an_option. - Expand the UEFI-only help text with additional options (PD reset/enable/disable, ME info, GPU descriptor dump, advanced PD addressing/ports, etc.).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
framework_lib/src/commandline/uefi.rs |
Fixes/extends UEFI argument parsing (new --remap-key, corrected flag names/messages, some parsing flow fixes). |
framework_lib/src/commandline/mod.rs |
Updates the UEFI help text to document additional options. |
Comments suppressed due to low confidence (2)
framework_lib/src/commandline/uefi.rs:385
--rgbkbdparsing currently iterates fromi + 1..args.len()andunwrap()s each value. This will (a) consume/attempt to parse subsequent flags (e.g.--tablet-mode) and panic, and (b) it doesn't accept hex values like0xFF0000that the Clap CLI supports. Consider stopping when the next arg starts with-(similar to--host-command) and parsing with a hex-or-dec helper, returning an empty vec (or leaving unset) with a clear error instead of panicking.
cli.rgbkbd = if args.len() > i + 2 {
let mut colors = Vec::<u64>::new();
for color_i in i + 1..args.len() {
// TODO: Fail parsing instead of unwrap()
colors.push(args[color_i].parse::<u64>().unwrap());
framework_lib/src/commandline/uefi.rs:581
- The validation/error message for
--pd-disablesays the PD number "Must be 0 or 1", but the rest of the codebase treats PD controller 2 (back) as valid as well (seecommandline/mod.rshandling ofpd_disable). This message should be updated to reflect the actual supported range (e.g. 0-2) to avoid confusing users.
cli.pd_disable = if args.len() > i + 1 {
if let Ok(pd) = args[i + 1].parse::<u8>() {
Some(pd)
} else {
println!(
"Invalid value for --pd-disable: '{}'. Must be 0 or 1.",
args[i + 1],
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
framework_lib/src/commandline/mod.rs
Outdated
Comment on lines
+1872
to
+1874
| --pd-addrs <PD_ADDRS> <PD_ADDRS> | ||
| Specify I2C addresses of the PD chips (Advanced) | ||
| --pd-ports <PD_PORTS> <PD_PORTS> |
They were recently added or forgotten earlier. Signed-off-by: Daniel Schaefer <dhs@frame.work>
Signed-off-by: Daniel Schaefer <dhs@frame.work>
Signed-off-by: Daniel Schaefer <dhs@frame.work>
Signed-off-by: Daniel Schaefer <dhs@frame.work>
It's used to print help if no valid option was found Signed-off-by: Daniel Schaefer <dhs@frame.work>
Signed-off-by: Daniel Schaefer <dhs@frame.work>
used already for --test -t Signed-off-by: Daniel Schaefer <dhs@frame.work>
a025d30 to
f0a6882
Compare
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
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.
No description provided.