(args: &[String])
| 263 | } |
| 264 | |
| 265 | pub fn parse(args: &[String]) -> Cli { |
| 266 | #[cfg(feature = "uefi")] |
| 267 | let cli = uefi::parse(args); |
| 268 | #[cfg(not(feature = "uefi"))] |
| 269 | let cli = clap_std::parse(args); |
| 270 | |
| 271 | if cfg!(feature = "readonly") { |
| 272 | // Initialize a new Cli with no arguments |
| 273 | // Set all arguments that are readonly/safe |
| 274 | // We explicitly only cope the safe ones so that if we add new arguments in the future, |
| 275 | // which might be unsafe, we can't forget to exclude them from the safe set. |
| 276 | // TODO: Instead of silently ignoring blocked command, we should remind the user |
| 277 | Cli { |
| 278 | verbosity: cli.verbosity, |
| 279 | versions: cli.versions, |
| 280 | version: cli.version, |
| 281 | features: cli.features, |
| 282 | esrt: cli.esrt, |
| 283 | device: cli.device, |
| 284 | compare_version: cli.compare_version, |
| 285 | power: cli.power, |
| 286 | thermal: cli.thermal, |
| 287 | sensors: cli.sensors, |
| 288 | // fansetduty |
| 289 | // fansetrpm |
| 290 | // autofanctrl |
| 291 | pdports: cli.pdports, |
| 292 | pdports_chromebook: cli.pdports_chromebook, |
| 293 | privacy: cli.privacy, |
| 294 | pd_info: cli.version, |
| 295 | // pd_reset |
| 296 | // pd_disable |
| 297 | // pd_enable |
| 298 | dp_hdmi_info: cli.dp_hdmi_info, |
| 299 | // dp_hdmi_update |
| 300 | audio_card_info: cli.audio_card_info, |
| 301 | pd_bin: cli.pd_bin, |
| 302 | ec_bin: cli.ec_bin, |
| 303 | capsule: cli.capsule, |
| 304 | dump: cli.dump, |
| 305 | h2o_capsule: cli.h2o_capsule, |
| 306 | // dump_ec_flash |
| 307 | // flash_full_ec |
| 308 | // flash_ec |
| 309 | // flash_ro_ec |
| 310 | // flash_rw_ec |
| 311 | driver: cli.driver, |
| 312 | test: cli.test, |
| 313 | test_retimer: cli.test_retimer, |
| 314 | boardid: cli.boardid, |
| 315 | dry_run: cli.dry_run, |
| 316 | // force |
| 317 | intrusion: cli.intrusion, |
| 318 | inputdeck: cli.inputdeck, |
| 319 | inputdeck_mode: cli.inputdeck_mode, |
| 320 | expansion_bay: cli.expansion_bay, |
| 321 | // charge_limit |
| 322 | // charge_current_limit |
no outgoing calls
no test coverage detected