From 5642499dc2a4fc7763e520722f5ca4e6ba2db077 Mon Sep 17 00:00:00 2001 From: NextAlone <12210746+NextAlone@users.noreply.github.com> Date: Sun, 26 Jun 2022 03:59:18 +0800 Subject: [PATCH] feat: completion for reflector (#9027) * feat: completion for reflector * fix --- share/completions/reflector.fish | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 share/completions/reflector.fish diff --git a/share/completions/reflector.fish b/share/completions/reflector.fish new file mode 100644 index 000000000..0a833ea3d --- /dev/null +++ b/share/completions/reflector.fish @@ -0,0 +1,30 @@ +complete -c reflector -f +# options +complete -c reflector -s h -l help -d 'Show help' +complete -c reflector -l connection-timeout -d 'The number of seconds to wait before a connection times out' +complete -c reflector -l download-timeout -d 'The number of seconds to wait before a download times out' +complete -c reflector -l list-countries -d 'Display a table of the distribution of servers by country' +complete -c reflector -l cache-timeout -d 'The cache timeout in seconds for the data retrieved from the Arch Linux Mirror Status API' +complete -c reflector -l url -d 'The URL from which to retrieve the mirror data in JSON format' +complete -c reflector -l save -d 'Save the mirrorlist to the given path' +complete -c reflector -l sort -d 'Sort the mirrorlist' -xa 'age rate country score delay' +complete -c reflector -l threads -d 'The number of threads to use for downloading' +complete -c reflector -l verbose -d 'Print extra information' +complete -c reflector -l info -d 'Print mirror information instead of a mirror list' + +# filters +complete -c reflector -s a -l age -d 'Only return mirrors that have synchronized in the last n hours' +complete -c reflector -l delay -d 'Only return mirrors with a reported sync delay of n hours or less, where n is a float' +complete -c reflector -s c -l country -d 'Restrict mirrors to selected countries' -xa "(reflector --list-countries | cut -f 1 -d ' ' | tail -n +3)" +complete -c reflector -s f -l fastest -d 'Return the n fastest mirrors that meet the other criteria' +complete -c reflector -s i -l include -d 'Include servers that match ' +complete -c reflector -s x -l exclude -d 'Exclude servers that match ' +complete -c reflector -s l -l latest -d 'Limit the list to the n most recently synchronized servers' +complete -c reflector -l score -d 'Limit the list to the n servers with the highest score' +complete -c reflector -s n -l number -d 'Return at most n mirrors' +complete -c reflector -s p -l protocol -d 'Match one of the given protocols' -xa 'http https ftp rsync' +complete -c reflector -l completion-percent -d 'Set the minimum completion percent for the returned mirrors' +complete -c reflector -l isos -d 'Only return mirrors that host ISOs' +complete -c reflector -l ipv4 -d 'Only return mirrors that support IPv4' +complete -c reflector -l ipv6 -d 'Only return mirrors that support IPv6' +