fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Johannes Altmanningercompletions/fastboot: one item per line8d257f5c5

master
5.3 KiB143 linesraw
1set -l commands flashall getvar oem flashing reboot update erase format devices flash get_staged help stage boot fetch
2
3function __fish_fastboot_list_partition_or_file
4    set -l tokens (commandline -xpc)
5    # if last 2 token is flash, then list file
6    if test (count $tokens) -gt 2
7        if test $tokens[-2] = flash
8            # complete files
9            __fish_complete_suffix .img
10            __fish_complete_suffix $tokens[-1]
11            return
12        end
13    end
14    __fish_fastboot_list_partition
15end
16
17function __fish_fastboot_list_partition
18    printf %s "\
19abl
20aop
21aop_config
22apdp
23bluetooth
24boot
25countrycode
26cpucp
27cpucp_dtb
28crclist
29dcp
30ddr
31devcfg
32dsp
33dtbo
34featenabler
35hyp
36hyp_ac_config
37idmanager
38imagefv
39init_boot
40keymaster
41logfs
42metadata
43misc
44modem
45modemfirmware
46multiimgoem
47multiimgqti
48pdp
49pdp_cdb
50pvmfw
51qtvm_dtbo
52qupfw
53recovery
54rescue
55secretkeeper
56shrm
57soccp
58soccp_dcd
59soccp_debug
60sparsecrclist
61spuservice
62storsec
63super
64tme_config
65tme_fw
66tme_seq_patch
67toolsfv
68tz
69tz_ac_config
70tz_qti_config
71uefi
72uefisecapp
73userdata
74vbmeta
75vbmeta_system
76vendor_boot
77vm-bootsys
78xbl
79xbl_ac_config
80xbl_config
81xbl_ramdump
82xbl_sc_test_mode
83"
84end
85
86complete -c fastboot -s h -l help -d 'Show this message'
87complete -c fastboot -s v -l verbose -d 'Verbose output'
88complete -c fastboot -l version -d 'Display version'
89
90complete -n "not __fish_seen_subcommand_from $commands" -c fastboot -s w -d 'Wipe userdata'
91complete -n "not __fish_seen_subcommand_from $commands" -c fastboot -s s -x -a "(fastboot devices)" -d 'Specify a device'
92complete -n "not __fish_seen_subcommand_from $commands" -c fastboot -s S -d 'Break into sparse files no larger than SIZE'
93complete -n "not __fish_seen_subcommand_from $commands" -c fastboot -l slot -d 'Use SLOT; \'all\' for both slots, \'other\' for non-current slot (default: current active slot)' -xa "all other a b"
94complete -n "not __fish_seen_subcommand_from $commands" -c fastboot -l set-active -d 'Sets the active slot before rebooting' -xa "a b"
95
96complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a flashall -d 'Flash all partitions from $ANDROID_PRODUCT_OUT'
97complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a getvar -d 'Display given bootloader variable'
98complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a oem -d 'Execute OEM-specific command'
99complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a flashing -d Lock/unlock
100complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a reboot -d 'Reboot device'
101complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a update -d 'Flash all partitions from an update.zip package'
102complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a erase -d 'Erase a flash partition'
103complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a format -d 'Format a flash partition'
104complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a devices -d 'List devices in bootloader'
105complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a flash -d 'Flash given partition'
106complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a help -d 'Show help message'
107complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a stage -d 'Sends given file to stage for the next command'
108complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a get_staged -d 'Writes data staged by the last command to a file'
109complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a fetch -d 'Fetch a partition image from the device'
110complete -f -n "not __fish_seen_subcommand_from $commands" -c fastboot -a boot -d 'Download and boot kernel from RAM'
111
112# flash
113complete -n '__fish_seen_subcommand_from flash' -c fastboot -f -k -a "(__fish_fastboot_list_partition_or_file)"
114complete -n '__fish_seen_subcommand_from flash' -c fastboot -l skip-secondary -d 'Don\'t flash secondary slots in flashall/update'
115complete -n '__fish_seen_subcommand_from flash' -c fastboot -l skip-reboot -d 'Don\'t reboot device after flashing'
116complete -n '__fish_seen_subcommand_from flash' -c fastboot -l disable-verity -d 'Sets disable-verity when flashing vbmeta'
117complete -n '__fish_seen_subcommand_from flash' -c fastboot -l disable-verification -d 'Sets disable-verification when flashing vbmeta'
118complete -n '__fish_seen_subcommand_from flash' -c fastboot -l force -d 'Force a flash operation that may be unsafe'
119
120# boot
121complete -n '__fish_seen_subcommand_from boot' -c fastboot
122
123# fetch
124complete -n '__fish_seen_subcommand_from fetch' -c fastboot -f -a "(__fish_fastboot_list_partition)"
125
126# devices
127complete -n '__fish_seen_subcommand_from devices' -c fastboot -f
128complete -n '__fish_seen_subcommand_from devices' -c fastboot -s l -d 'device paths'
129
130# format
131complete -n '__fish_seen_subcommand_from format' -c fastboot -f -a "(__fish_fastboot_list_partition)"
132
133# erase
134complete -n '__fish_seen_subcommand_from erase' -c fastboot -f -a "(__fish_fastboot_list_partition)"
135
136# flashing
137complete -n '__fish_seen_subcommand_from flashing' -c fastboot -f -a "lock unlock lock_critical unlock_critical get_unlock_ability"
138
139# reboot
140complete -n '__fish_seen_subcommand_from reboot' -c fastboot -xa 'bootloader fastboot'
141
142# oem
143complete -n '__fish_seen_subcommand_from oem' -c fastboot -xa 'device-info lock unlock edl'