fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
0df6fa791
master
1# excluding help 2set -l subcommands frequency-info frequency-set idle-info idle-set set info monitor 3 4# disable file completion 5complete -fc cpupower 6 7# common switches 8complete -c cpupower -s h -l help -d"Show supported commands and general usage" 9complete -c cpupower -s c -l cpu -x -a all -d"Only show or set values for specific cores" # im not gonna write completion for the cpu bit mask stuff thingy 10 11# complete subcommands 12complete -c cpupower -n"not __fish_seen_subcommand_from $subcommands help" -a help -d"Show manpage for subcommands" 13complete -c cpupower -n"not __fish_seen_subcommand_from $subcommands help" -a frequency-info -d"Retrieve cpufreq kernel information" 14complete -c cpupower -n"not __fish_seen_subcommand_from $subcommands help" -a frequency-set -d"Modify cpufreq settings" 15complete -c cpupower -n"not __fish_seen_subcommand_from $subcommands help" -a idle-info -d"Retrieve cpu idle kernel information" 16complete -c cpupower -n"not __fish_seen_subcommand_from $subcommands help" -a idle-set -d"Set cpu idle state specific kernel options" 17complete -c cpupower -n"not __fish_seen_subcommand_from $subcommands help" -a set -d"Set processor power related kernel or hardware config" 18complete -c cpupower -n"not __fish_seen_subcommand_from $subcommands help" -a info -d"Show processor power related kernel or hardware config" 19complete -c cpupower -n"not __fish_seen_subcommand_from $subcommands help" -a monitor -d"Report processor frequency and idle statistics" 20 21# complete other subcommands after 'help', but only once 22complete -c cpupower -n"__fish_seen_subcommand_from help && not __fish_seen_subcommand_from $subcommands " -x -a"frequency-info frequency-set idle-info idle-set set info monitor" 23 24complete -c cpupower -n"__fish_seen_subcommand_from frequency-info" -s e -l debug -d"Prints out debug information" 25complete -c cpupower -n"__fish_seen_subcommand_from frequency-info" -s f -l freq -d"Get frequency the CPU currently runs at, according to the cpufreq core" 26complete -c cpupower -n"__fish_seen_subcommand_from frequency-info" -s w -l hwfreq -d"Get frequency the CPU currently runs at, by reading it from hardware" 27complete -c cpupower -n"__fish_seen_subcommand_from frequency-info" -s l -l hwlimits -d"Determine the minimum and maximum CPU frequency allowed" 28complete -c cpupower -n"__fish_seen_subcommand_from frequency-info" -s d -l driver -d"Determines the used cpufreq kernel driver" 29complete -c cpupower -n"__fish_seen_subcommand_from frequency-info" -s p -l policy -d"Gets the currently used cpufreq policy" 30complete -c cpupower -n"__fish_seen_subcommand_from frequency-info" -s g -l governors -d"Determines available cpufreq governors" 31complete -c cpupower -n"__fish_seen_subcommand_from frequency-info" -s s -l stats -d"Shows cpufreq statistics if available" 32complete -c cpupower -n"__fish_seen_subcommand_from frequency-info" -s y -l latency -d"Determines the maximum latency on CPU frequency changes" 33complete -c cpupower -n"__fish_seen_subcommand_from frequency-info" -s o -l proc -d"Prints out information like the old /proc/cpufreq" 34complete -c cpupower -n"__fish_seen_subcommand_from frequency-info" -s m -l human -d"human-readable output for the -f, -w, -s and -y parameters" 35complete -c cpupower -n"__fish_seen_subcommand_from frequency-info" -s n -l no-rounding -d"Output frequencies and latencies without rounding off values" 36# according to the manual, both of these have the short switch '-a', but -a seems to behave as the letter 37complete -c cpupower -n"__fish_seen_subcommand_from frequency-info" -l related-cpus -a"Determines which CPUs run at the same hardware frequency" 38complete -c cpupower -n"__fish_seen_subcommand_from frequency-info" -s a -l affected-cpus -a"Determines which CPUs need to have their frequency coordinated by software" 39 40complete -c cpupower -n"__fish_seen_subcommand_from frequency-set" -s d -l min -x -d"new minimum CPU frequency the governor may select" 41complete -c cpupower -n"__fish_seen_subcommand_from frequency-set" -s u -l max -x -d"new maximum CPU frequency the governor may select" 42complete -c cpupower -n"__fish_seen_subcommand_from frequency-set" -s g -l governor -x -a"(string split ' ' < /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors)" -d"new cpufreq governor" 43complete -c cpupower -n"__fish_seen_subcommand_from frequency-set" -s f -l freq -x -d"specific frequency to be set. Requires userspace governor to be available and loaded" 44complete -c cpupower -n"__fish_seen_subcommand_from frequency-set" -s r -l related -d"modify all hardware-related CPUs at the same time" 45 46complete -c cpupower -n"__fish_seen_subcommand_from idle-info" -s f -l silent -d"Only print a summary of all available C-states in the system" 47 48set -l idlestates( LC_ALL=C cpupower idle-info| string replace -f'Available idle states: ' '' ) 49complete -c cpupower -n"__fish_seen_subcommand_from idle-set" -s d -l disable -x -a" $idlestates " -d"Disable a specific processor sleep state" 50complete -c cpupower -n"__fish_seen_subcommand_from idle-set" -s e -l enable -x -a" $idlestates " -d"Enable a specific processor sleep state" 51complete -c cpupower -n"__fish_seen_subcommand_from idle-set" -s D -l disable-by-latency -x -d"Disable all idle states with a equal or higher latency than <LATENCY>" 52complete -c cpupower -n"__fish_seen_subcommand_from idle-set" -s E -l enable-all -d"Enable all idle states if not enabled already" 53 54complete -c cpupower -n"__fish_seen_subcommand_from set" -s b -l perf-bias -d"Set relative importance of performance vs energy savings" 55complete -c cpupower -n"__fish_seen_subcommand_from info" -s b -l perf-bias -d"Get relative importance of performance vs energy savings" 56 57set -l monitors( LC_ALL=C cpupower monitor -l2>&1 | awk '$1 == "Monitor" {gsub(/"/, "", $2); print $2} $1 == "Available" {print $3}' ) 58complete -c cpupower -n"__fish_seen_subcommand_from monitor" -s m -x -a" $monitors " -d"Only display this monitor" 59complete -c cpupower -n"__fish_seen_subcommand_from monitor" -s v -d"Increase verbosity if the binary was compiled with the DEBUG option set" 60complete -c cpupower -n"__fish_seen_subcommand_from monitor" -s c -d"Schedule the process on every core before starting and ending measuring" 61complete -c cpupower -n"__fish_seen_subcommand_from monitor" -s i -d"Measure interval" 62complete -c cpupower -n"__fish_seen_subcommand_from monitor" -s l -d"List available monitors on your system"