fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
9367d4ff7
master
1function __fish_ipset_nosubcommand 2if __fish_seen_subcommand_from create add del test destroy list save restore flush rename swap help version 3return 1 4end 5return 0 6end 7 8function __fish_ipset_needs_setname 9if __fish_seen_subcommand_from add del test destroy list save restore flush rename swap 10return 0 11end 12return 1 13end 14 15function __fish_ipset_list_sets 16set -l ipset_list( ipset list --name2> /dev/null) 17if not __fish_seen_subcommand_from $ipset_list 18echo $ipset_list 19end 20end 21 22complete -c ipset --no-files --condition __fish_ipset_nosubcommand -a create -d'Create a set identified with SETNAME' 23complete -c ipset --no-files --condition __fish_ipset_nosubcommand -a add -d'Add a given entry to a SET' 24complete -c ipset --no-files --condition __fish_ipset_nosubcommand -a del -d'Delete an entry from a SET' 25complete -c ipset --no-files --condition __fish_ipset_nosubcommand -a test -d'Test whether an entry is in a set' 26complete -c ipset --no-files --condition __fish_ipset_nosubcommand -a x -d'Destroy the specified set or all sets' 27complete -c ipset --no-files --condition __fish_ipset_nosubcommand -a destroy -d'Destroy the specified set or all sets' 28complete -c ipset --no-files --condition __fish_ipset_nosubcommand -a list -d a 29 30complete -c ipset --no-files --condition __fish_ipset_needs_setname -a'(__fish_ipset_list_sets)' 31 32complete -c ipset --no-files -s ! -o exist -d'Ignore errors' 33complete -c ipset --no-files -s o -o output -a'plain save xml' -d'Output format to the list command' 34complete -c ipset --no-files -s q -o quiet -d'Suppress any output' 35complete -c ipset --no-files -s r -o resolve -d'Enforce name lookup' 36# complete -c ipset --no-files -s 's' -o 'sorted' -d 'Sorted output (not supported yet)' 37complete -c ipset --no-files -s n -o name -d'List just the names of the sets' 38complete -c ipset --no-files -s t -o terse -d'List the set names and headers' 39complete -c ipset --no-files -s f -o file -d'Filename instead of stdout'