-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
complete -c xmirror -f | ||
|
||
function __xmirror_complete_mirrors | ||
string match -vr '^\s*#' </usr/share/xmirror/mirrors.lst | while read -l line | ||
set -l values (string split \t -- $line) | ||
# Mirror url, location, and tier | ||
echo -- $values[2]\t$values[3], Tier $values[4] | ||
end | ||
end | ||
|
||
function __xmirror_no_interactive_opts | ||
not __fish_seen_argument -s l -l mirror-list -s n -l no-fetch | ||
end | ||
|
||
function __xmirror_no_noninteractive_opts | ||
not __fish_seen_argument -s d -l default -s s -l set | ||
end | ||
|
||
complete -c xmirror -s h -l help -d 'Display help and exit' | ||
complete -c xmirror -s v -l version -d 'Display version and exit' | ||
complete -c xmirror -s r -l rootdir -d 'Use alternative rootdir' -xa '(__fish_complete_directories)' | ||
complete -c xmirror -n '__xmirror_no_noninteractive_opts' -s l -l mirror-list -d 'Use alternative mirror list file' -rF | ||
complete -c xmirror -n '__xmirror_no_noninteractive_opts' -s n -l no-fetch -d "Don't update mirror list" | ||
complete -c xmirror -n '__xmirror_no_interactive_opts' -s d -l default -d 'Reset current mirror to default' | ||
complete -c xmirror -n '__xmirror_no_interactive_opts' -s s -l set -d 'Set current mirror' -kxa '(__xmirror_complete_mirrors)' |