From ce27036b23245e9e85d33f0186b65c8672a46c0a Mon Sep 17 00:00:00 2001 From: Lars Engels Date: Mon, 24 Mar 2025 21:41:28 +0100 Subject: [PATCH 1/3] Add ZSH completion for framework_tool --- completions/zsh/_framework_tool | 51 +++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 completions/zsh/_framework_tool diff --git a/completions/zsh/_framework_tool b/completions/zsh/_framework_tool new file mode 100644 index 00000000..896c587d --- /dev/null +++ b/completions/zsh/_framework_tool @@ -0,0 +1,51 @@ +#compdef framework_tool + +local -a options + +options=( + '-v[Increase logging verbosity]' + '-q[Decrease logging verbosity]' + '--versions[Show current firmware versions]' + '--version[Show tool version information (Add -vv for more details)]' + '--features[Show features supported by the firmware]' + '--esrt[Display the UEFI ESRT table]' + '--device[Specify device type]:device:(bios ec pd0 pd1 rtm01 rtm23 ac-left ac-right)' + '--compare-version[Specify version to compare]:compare_version' + '--power[Show current power status of battery and AC (Add -vv for more details)]' + '--thermal[Print thermal information (Temperatures and Fan speed)]' + '--sensors[Print sensor information (ALS, G-Sensor)]' + '--pdports[Show information about USB-C PD ports]' + '--info[Show info from SMBIOS (Only on UEFI)]' + '--pd-info[Show details about the PD controllers]' + '--dp-hdmi-info[Show details about connected DP or HDMI Expansion Cards]' + '--dp-hdmi-update[Update the DisplayPort or HDMI Expansion Card]:update_bin' + '--audio-card-info[Show details about connected Audio Expansion Cards (Needs root privileges)]' + '--privacy[Show privacy switch statuses (camera and microphone)]' + '--pd-bin[Parse versions from PD firmware binary file]:pd_bin' + '--ec-bin[Parse versions from EC firmware binary file]:ec_bin' + '--capsule[Parse UEFI Capsule information from binary file]:capsule' + '--dump[Dump extracted UX capsule bitmap image to a file]:dump' + '--ho2-capsule[Parse UEFI Capsule information from binary file]:ho2_capsule' + '--dump-ec-flash[Dump EC flash contents]:dump_ec_flash' + '--flash-ec[Flash EC with new firmware from file]:flash_ec' + '--flash-ro-ec[Flash EC with new RO firmware from file]:flash_ro_ec' + '--flash-rw-ec[Flash EC with new RW firmware from file]:flash_rw_ec' + '--intrusion[Show status of intrusion switch]' + '--inputmodules[Show status of the input modules (Framework 16 only)]' + '--input-deck-mode[Set input deck power mode]:input_deck_mode:(auto off on)' + '--charge-limit[Get or set max charge limit]:charge_limit' + '--get-gpio[Get GPIO value by name]:get_gpio' + '--fp-brightness[Get or set fingerprint LED brightness]:fp_brightness:(high medium low)' + '--kblight[Set keyboard backlight percentage or get, if no value provided]:kblight' + '--console[Get EC console, choose whether recent or to follow the output]:console:(recent follow)' + '--reboot-ec[Control EC RO/RW jump]:reboot_ec:(reboot jump-ro jump-rw cancel-jump disable-jump)' + '--hash[Hash a file of arbitrary data]:hash' + '--driver[Select which driver is used]:driver:(portio cros-ec windows)' + '--pd-addrs[Specify I2C addresses of the PD chips (Advanced)]:pd_addrs' + '--pd-ports[Specify I2C ports of the PD chips (Advanced)]:pd_ports' + '--has-mec[Specify the type of EC chip (MEC/MCHP or other)]:has_mec:(true false)' + '-t[Run self-test to check if interaction with EC is possible]' + '-h[Print help]' +) + +_arguments -s -S $options From 034a1093c483aa6a92d1b9bbd019c3a9c0f7edf2 Mon Sep 17 00:00:00 2001 From: Lars Engels Date: Mon, 24 Mar 2025 21:48:37 +0100 Subject: [PATCH 2/3] Add Bash completion for framework_tool --- completions/bash/framework_tool | 84 +++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100755 completions/bash/framework_tool diff --git a/completions/bash/framework_tool b/completions/bash/framework_tool new file mode 100755 index 00000000..a0826437 --- /dev/null +++ b/completions/bash/framework_tool @@ -0,0 +1,84 @@ +#!/usr/bin/env bash + +# Bash completion for framework_tool + +_framework_tool() { + local options + options=( + "-v" "--verbose" + "-q" "--quiet" + "--versions" + "--version" + "--features" + "--esrt" + "--device" + "--compare-version" + "--power" + "--thermal" + "--sensors" + "--pdports" + "--info" + "--pd-info" + "--dp-hdmi-info" + "--dp-hdmi-update" + "--audio-card-info" + "--privacy" + "--pd-bin" + "--ec-bin" + "--capsule" + "--dump" + "--ho2-capsule" + "--dump-ec-flash" + "--flash-ec" + "--flash-ro-ec" + "--flash-rw-ec" + "--intrusion" + "--inputmodules" + "--input-deck-mode" + "--charge-limit" + "--get-gpio" + "--fp-brightness" + "--kblight" + "--console" + "--reboot-ec" + "--hash" + "--driver" + "--pd-addrs" + "--pd-ports" + "--has-mec" + "-t" "--test" + "-h" "--help" + ) + + local devices=("bios" "ec" "pd0" "pd1" "rtm01" "rtm23" "ac-left" "ac-right") + local input_deck_modes=("auto" "off" "on") + local console_modes=("recent" "follow") + local drivers=("portio" "cros-ec" "windows") + local has_mec_options=("true" "false") + local brightness_options=("high" "medium" "low") + + local current_word prev_word + current_word="${COMP_WORDS[COMP_CWORD]}" + prev_word="${COMP_WORDS[COMP_CWORD-1]}" + + # Handle options + if [[ $COMP_CWORD -eq 1 ]]; then + COMPREPLY=( $(compgen -W "${options[*]}" -- "$current_word") ) + elif [[ $prev_word == "--device" ]]; then + COMPREPLY=( $(compgen -W "${devices[*]}" -- "$current_word") ) + elif [[ $prev_word == "--input-deck-mode" ]]; then + COMPREPLY=( $(compgen -W "${input_deck_modes[*]}" -- "$current_word") ) + elif [[ $prev_word == "--console" ]]; then + COMPREPLY=( $(compgen -W "${console_modes[*]}" -- "$current_word") ) + elif [[ $prev_word == "--driver" ]]; then + COMPREPLY=( $(compgen -W "${drivers[*]}" -- "$current_word") ) + elif [[ $prev_word == "--has-mec" ]]; then + COMPREPLY=( $(compgen -W "${has_mec_options[*]}" -- "$current_word") ) + elif [[ $prev_word == "--fp-brightness" ]]; then + COMPREPLY=( $(compgen -W "${brightness_options[*]}" -- "$current_word") ) + fi + + return 0 +} + +complete -F _framework_tool framework_tool From 8a90c3789d09945900bea583f10c56d242cf28a1 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Thu, 17 Apr 2025 02:44:00 +0800 Subject: [PATCH 3/3] completions: Add new commands Signed-off-by: Daniel Schaefer --- completions/bash/framework_tool | 7 ++++++- completions/zsh/_framework_tool | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/completions/bash/framework_tool b/completions/bash/framework_tool index a0826437..24f41d46 100755 --- a/completions/bash/framework_tool +++ b/completions/bash/framework_tool @@ -5,6 +5,7 @@ _framework_tool() { local options options=( + "--flash-gpu-descriptor" "-v" "--verbose" "-q" "--quiet" "--versions" @@ -37,8 +38,12 @@ _framework_tool() { "--input-deck-mode" "--charge-limit" "--get-gpio" + "--fp-led-level" "--fp-brightness" "--kblight" + "--rgbkbd" + "--tablet-mode" + "--touchscreen-enable" "--console" "--reboot-ec" "--hash" @@ -55,7 +60,7 @@ _framework_tool() { local console_modes=("recent" "follow") local drivers=("portio" "cros-ec" "windows") local has_mec_options=("true" "false") - local brightness_options=("high" "medium" "low") + local brightness_options=("high" "medium" "low" "ultra-low") local current_word prev_word current_word="${COMP_WORDS[COMP_CWORD]}" diff --git a/completions/zsh/_framework_tool b/completions/zsh/_framework_tool index 896c587d..70ea7516 100644 --- a/completions/zsh/_framework_tool +++ b/completions/zsh/_framework_tool @@ -3,6 +3,7 @@ local -a options options=( + '--flash-gpu-descriptor[]' '-v[Increase logging verbosity]' '-q[Decrease logging verbosity]' '--versions[Show current firmware versions]' @@ -35,8 +36,12 @@ options=( '--input-deck-mode[Set input deck power mode]:input_deck_mode:(auto off on)' '--charge-limit[Get or set max charge limit]:charge_limit' '--get-gpio[Get GPIO value by name]:get_gpio' - '--fp-brightness[Get or set fingerprint LED brightness]:fp_brightness:(high medium low)' + '--fp-led-level-gpio[Get or set fingerprint LED brightness level]:fp_led_level:(high medium low ultra-low auto)' + '--fp-brightness[Get or set fingerprint LED brightness]:fp_brightness' '--kblight[Set keyboard backlight percentage or get, if no value provided]:kblight' + '--rgbkbd[Set the color of to .]' + '--tablet-mode[Set tablet mode override]:tablet_mode:(auto tablet laptop)' + '--touchscreen-enable[Enable/disable touchscreen]:touchscreen_enable:(true false)' '--console[Get EC console, choose whether recent or to follow the output]:console:(recent follow)' '--reboot-ec[Control EC RO/RW jump]:reboot_ec:(reboot jump-ro jump-rw cancel-jump disable-jump)' '--hash[Hash a file of arbitrary data]:hash'