about summary refs log tree commit diff
path: root/fish/functions/__xtools_complete_repo_urls.fish
diff options
context:
space:
mode:
authortriallax <triallax@tutanota.com>2023-09-20 19:54:16 +0100
committerLeah Neukirchen <leah@vuxu.org>2023-10-22 01:28:11 +0200
commit87845f52f18e1dedc963f1c7a86b33f3248d21fe (patch)
tree0f1a5cccff4b706bb05fe25a9a125d297305b9d5 /fish/functions/__xtools_complete_repo_urls.fish
parenta3742437505609e847ba7e59c60ea395e708e729 (diff)
downloadxtools-87845f52f18e1dedc963f1c7a86b33f3248d21fe.tar.gz
xtools-87845f52f18e1dedc963f1c7a86b33f3248d21fe.tar.xz
xtools-87845f52f18e1dedc963f1c7a86b33f3248d21fe.zip
completions: add fish completions.
Diffstat (limited to 'fish/functions/__xtools_complete_repo_urls.fish')
-rw-r--r--fish/functions/__xtools_complete_repo_urls.fish9
1 files changed, 9 insertions, 0 deletions
diff --git a/fish/functions/__xtools_complete_repo_urls.fish b/fish/functions/__xtools_complete_repo_urls.fish
new file mode 100644
index 0000000..052d234
--- /dev/null
+++ b/fish/functions/__xtools_complete_repo_urls.fish
@@ -0,0 +1,9 @@
+function __xtools_complete_repo_urls
+    if [ -e /usr/share/xmirror/mirrors.lst ]
+        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
+end