fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
566a673e4
master
1# Only GNU and BSD sysctl seem to know "-h", so others should exit non-zero 2if sysctl -h> /dev/null2> /dev/null 3# Print sysctl keys and values, separated by a tab 4function __fish_sysctl_values 5sysctl -a2> /dev/null| string replace -a" = " \t 6end 7 8complete -c sysctl -a'(__fish_sysctl_values)' -f 9 10complete -c sysctl -s n -l values -d'Only print values' 11complete -c sysctl -s e -l ignore -d'Ignore errors about unknown keys' 12complete -c sysctl -s N -l names -d'Only print names' 13complete -c sysctl -s q -l quiet -d'Be quiet when setting values' 14complete -c sysctl -s w -l write -d'Write value' 15complete -c sysctl -s p -l load -d'Load in sysctl settings from the file specified or /etc/sysctl' 16complete -c sysctl -s a -l all -d'Display all values currently available' 17complete -c sysctl -l deprecated -d'Include deprecated parameters too' 18complete -c sysctl -s b -l binary -d'Print value without new line' 19complete -c sysctl -l system -d'Load settings from all system configuration files' 20complete -c sysctl -s r -l pattern -d'Only apply settings that match pattern' 21# Don't include these as they don't do anything 22# complete -c sysctl -s A -d 'Alias of -a' 23# complete -c sysctl -s d -d 'Alias of -h' 24# complete -c sysctl -s f -d 'Alias of -p' 25# complete -c sysctl -s X -d 'Alias of -a' 26# complete -c sysctl -s o -d 'Does nothing, exists for BSD compatibility' 27# complete -c sysctl -s x -d 'Does nothing, exists for BSD compatibility' 28complete -c sysctl -s h -l help -d'Display help text and exit.' 29complete -c sysctl -s V -l version -d'Display version information and exit.' 30else 31# OSX sysctl 32function __fish_sysctl_values 33sysctl -a2> /dev/null| string replace -a":" \t 34end 35 36complete -c sysctl -a'(__fish_sysctl_values)' -f 37complete -c sysctl -s a -d'Display all non-opaque values currently available' 38complete -c sysctl -s A -d'Display all MIB variables' 39complete -c sysctl -s b -d'Output values in a binary format' 40complete -c sysctl -s n -d'Show only values, not names' 41complete -c sysctl -s w -d'Set values' 42complete -c sysctl -s X -d'Like -A, but prints a hex dump' 43end